Skip to contentSkip to conversation

ceph: remove the incorrect Fw reference check when dirtying pages

PATCH In review [email protected] 3 participants 3 messages Sep 4, 2024 – Sep 27, 2024 Ceph client

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: remove the incorrect Fw reference check when dirtying pages

From: Xiubo Li <[email protected]>

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")
---
 fs/ceph/addr.c | 1 -
 1 file changed, 1 deletion(-)
fs/ceph/addr.c +0 -1
index c4744a02db75..0df4623785dd 100644
@@ -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,
Signature · 1 line
2.45.1
Reviewed-by Tested-by on v1 1/1
#2 lore raw
In reply to [email protected]
Quoted 26 lines · On Thu, Sep 5, 2024 at 4:00 AM <[email protected]> wrote:

From: Xiubo Li <[email protected]>

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")
---
 fs/ceph/addr.c | 1 -
 1 file changed, 1 deletion(-)
fs/ceph/addr.c +0 -2
index c4744a02db75..0df4623785dd 100644
@@ -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,
--
Quoted 2 lines

2.45.1

Signature · 2 lines
Cheers,
Venky