Skip to content

Commit 15c0a87

Browse files
lxbszidryomov
authored andcommitted
ceph: fix incorrect revoked caps assert in ceph_fill_file_size()
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] Link: https://tracker.ceph.com/issues/56693 Fixes: b0d7c22 ("ceph: introduce i_truncate_mutex") Signed-off-by: Xiubo Li <[email protected]> Reviewed-by: Milind Changire <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 94f6f05 commit 15c0a87

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/ceph/inode.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -769,9 +769,7 @@ int ceph_fill_file_size(struct inode *inode, int issued,
769769
ci->i_truncate_seq = truncate_seq;
770770

771771
/* the MDS should have revoked these caps */
772-
WARN_ON_ONCE(issued & (CEPH_CAP_FILE_EXCL |
773-
CEPH_CAP_FILE_RD |
774-
CEPH_CAP_FILE_WR |
772+
WARN_ON_ONCE(issued & (CEPH_CAP_FILE_RD |
775773
CEPH_CAP_FILE_LAZYIO));
776774
/*
777775
* If we hold relevant caps, or in the case where we're

0 commit comments

Comments
 (0)