From: Yan, Zheng Date: Thu, 5 Mar 2020 12:21:04 +0000 (+0800) Subject: ceph: check all mds' caps after page writeback X-Git-Tag: v5.7-rc1~39^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bf73c62e7ff8dc220f3f57df4e42f9947320c447;p=thirdparty%2Fkernel%2Flinux.git ceph: check all mds' caps after page writeback If an inode has caps from multiple mds's, the following can happen: - non-auth mds revokes Fsc. Fcb is used, so page writeback is queued. - when writeback finishes, ceph_check_caps() is called with auth only flag. ceph_check_caps() invalidates pagecache, but skips checking any non-auth caps. Signed-off-by: "Yan, Zheng" Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov --- diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 0b3a363100332..342a32c74c64e 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -3062,7 +3062,7 @@ void ceph_put_wrbuffer_cap_refs(struct ceph_inode_info *ci, int nr, spin_unlock(&ci->i_ceph_lock); if (last) { - ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL); + ceph_check_caps(ci, 0, NULL); } else if (flush_snaps) { ceph_flush_snaps(ci, NULL); } diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index c7ff9f7067f6d..ee40ba7e0e770 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -1984,7 +1984,7 @@ retry: mutex_unlock(&ci->i_truncate_mutex); if (wrbuffer_refs == 0) - ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL); + ceph_check_caps(ci, 0, NULL); wake_up_all(&ci->i_cap_wq); }