ceph: check all mds' caps after page writeback
authorYan, Zheng <zyan@redhat.com>
Thu, 5 Mar 2020 12:21:04 +0000 (20:21 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 30 Mar 2020 10:42:42 +0000 (12:42 +0200)
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" <zyan@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/caps.c
fs/ceph/inode.c

index 0b3a36310033297b567616396e08daa6a359cc45..342a32c74c64ef8740e762a3937383db1de38bdd 100644 (file)
@@ -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);
        }
index c7ff9f7067f6db8bd43923a68b2b24ed3af3309a..ee40ba7e0e770c5840b181a760107a00b58274f6 100644 (file)
@@ -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);
 }