Skip to contentSkip to conversation

ceph: remove the incorrect caps check in _file_size()

PATCH Superseded [email protected] 2 participants 3 messages Sep 6, 2023 – Sep 7, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: remove the incorrect caps check in _file_size()

From: Xiubo Li <[email protected]>

When truncating the inode the MDS will acquire the xlock for the ifile Locker, which will revoke the 'Frwsxl' caps from the clients. But when the client just releases and flushes the 'Fw' caps to MDS, for exmaple, and once the MDS receives the caps flushing msg it just thought the revocation has finished. Then the MDS will continue truncating the inode and then issued the truncate notification to all the clients. While just before the clients receives the cap flushing ack they receive the truncation notification, the clients will detecte that the 'issued | dirty' is still holding the 'Fw' caps.

Cc: [email protected]
URL: https://tracker.ceph.com/issues/56693

---
 fs/ceph/inode.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/ceph/inode.c +1 -3
index ea6f966dacd5..8017b9e5864f 100644
@@ -769,9 +769,7 @@ int ceph_fill_file_size(struct inode *inode, int issued,
 			ci->i_truncate_seq = truncate_seq;
 
 			/* the MDS should have revoked these caps */
-			WARN_ON_ONCE(issued & (CEPH_CAP_FILE_EXCL |
-					       CEPH_CAP_FILE_RD |
-					       CEPH_CAP_FILE_WR |
+			WARN_ON_ONCE(issued & (CEPH_CAP_FILE_RD |
 					       CEPH_CAP_FILE_LAZYIO));
 			/*
 			 * If we hold relevant caps, or in the case where we're
Signature · 1 line
2.41.0
maintainer
#1 lore raw
Quoted 13 lines · On Wed, Sep 06, 2023 at 08:17:47PM +0800, [email protected] wrote:

From: Xiubo Li <[email protected]>

When truncating the inode the MDS will acquire the xlock for the ifile Locker, which will revoke the 'Frwsxl' caps from the clients. But when the client just releases and flushes the 'Fw' caps to MDS, for exmaple, and once the MDS receives the caps flushing msg it just thought the revocation has finished. Then the MDS will continue truncating the inode and then issued the truncate notification to all the clients. While just before the clients receives the cap flushing ack they receive the truncation notification, the clients will detecte that the 'issued | dirty' is still holding the 'Fw' caps.

Quoted 6 lines

Cc: [email protected]
URL: https://tracker.ceph.com/issues/56693

---
 fs/ceph/inode.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

What commit id does this fix?

thanks,

greg k-h

author
#2 lore raw
Quoted 14 lines · Greg KH
Quoted 13 lines · On Wed, Sep 06, 2023 at 08:17:47PM +0800, [email protected] wrote:

From: Xiubo Li <[email protected]>

When truncating the inode the MDS will acquire the xlock for the ifile Locker, which will revoke the 'Frwsxl' caps from the clients. But when the client just releases and flushes the 'Fw' caps to MDS, for exmaple, and once the MDS receives the caps flushing msg it just thought the revocation has finished. Then the MDS will continue truncating the inode and then issued the truncate notification to all the clients. While just before the clients receives the cap flushing ack they receive the truncation notification, the clients will detecte that the 'issued | dirty' is still holding the 'Fw' caps.

Quoted 7 lines
Quoted 6 lines

Cc: [email protected]
URL: https://tracker.ceph.com/issues/56693

---
  fs/ceph/inode.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)

What commit id does this fix?

Oh, I forgot to mention that in the commit comment, it will fix:

b0d7c2231015 ceph: introduce i_truncate_mutex

Let me update the patch and send out the V2 for it.

Thanks

- Xiubo

Quoted 4 lines

thanks,

greg k-h