diff mbox series

ceph: remove the incorrect Fw reference check when dirtying pages

Message ID 20240904222952.937201-1-xiubli@redhat.com
State New
Headers show
Series ceph: remove the incorrect Fw reference check when dirtying pages | expand

Commit Message

Xiubo Li Sept. 4, 2024, 10:29 p.m. UTC
From: Xiubo Li <xiubli@redhat.com>

When doing the direct-io reads it will also try to mark pages dirty,
but for the read path it won't hold the Fw caps and there is case
will it get the Fw reference.

Fixes: 5dda377cf0a6 ("ceph: set i_head_snapc when getting CEPH_CAP_FILE_WR reference")
Signed-off-by: Xiubo Li <xiubli@redhat.com>
---
 fs/ceph/addr.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Patrick Donnelly Sept. 24, 2024, 1:27 a.m. UTC | #1
Fantastic work Xiubo.

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Venky Shankar Sept. 27, 2024, 11:31 a.m. UTC | #2
On Thu, Sep 5, 2024 at 4:00 AM <xiubli@redhat.com> wrote:
>
> From: Xiubo Li <xiubli@redhat.com>
>
> When doing the direct-io reads it will also try to mark pages dirty,
> but for the read path it won't hold the Fw caps and there is case
> will it get the Fw reference.
>
> Fixes: 5dda377cf0a6 ("ceph: set i_head_snapc when getting CEPH_CAP_FILE_WR reference")
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> ---
>  fs/ceph/addr.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> index c4744a02db75..0df4623785dd 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -95,7 +95,6 @@ static bool ceph_dirty_folio(struct address_space *mapping, struct folio *folio)
>
>         /* dirty the head */
>         spin_lock(&ci->i_ceph_lock);
> -       BUG_ON(ci->i_wr_ref == 0); // caller should hold Fw reference
>         if (__ceph_have_pending_cap_snap(ci)) {
>                 struct ceph_cap_snap *capsnap =
>                                 list_last_entry(&ci->i_cap_snaps,
> --
> 2.45.1
>

Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>
diff mbox series

Patch

diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index c4744a02db75..0df4623785dd 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -95,7 +95,6 @@  static bool ceph_dirty_folio(struct address_space *mapping, struct folio *folio)
 
 	/* dirty the head */
 	spin_lock(&ci->i_ceph_lock);
-	BUG_ON(ci->i_wr_ref == 0); // caller should hold Fw reference
 	if (__ceph_have_pending_cap_snap(ci)) {
 		struct ceph_cap_snap *capsnap =
 				list_last_entry(&ci->i_cap_snaps,