ceph: fix incorrect revoked caps assert in ceph_fill_file_size()
authorXiubo Li <xiubli@redhat.com>
Wed, 6 Sep 2023 06:22:07 +0000 (14:22 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 9 Oct 2023 11:35:24 +0000 (13:35 +0200)
commit15c0a870dc44ed14e01efbdd319d232234ee639f
treed0fa53a603d1bda3772a107a209839693cd31a91
parent94f6f0550c625fab1f373bb86a6669b45e9748b3
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: stable@vger.kernel.org
Link: https://tracker.ceph.com/issues/56693
Fixes: b0d7c2231015 ("ceph: introduce i_truncate_mutex")
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/inode.c