]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ceph: wait on async create before checking caps for syncfs
authorJeff Layton <jlayton@kernel.org>
Mon, 6 Jun 2022 23:31:42 +0000 (19:31 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 29 Jun 2022 16:02:57 +0000 (18:02 +0200)
Currently, we'll call ceph_check_caps, but if we're still waiting
on the reply, we'll end up spinning around on the same inode in
flush_dirty_session_caps. Wait for the async create reply before
flushing caps.

Cc: stable@vger.kernel.org
URL: https://tracker.ceph.com/issues/55823
Fixes: 9580b74e7440 ("ceph: wait for async create reply before sending any cap messages")
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/caps.c

index 38c930384d417dc33ab527546b46fef858d9268d..ac8fd5e7f5405f345fe12a7276819f3a513309fe 100644 (file)
@@ -4377,6 +4377,7 @@ static void flush_dirty_session_caps(struct ceph_mds_session *s)
                ihold(inode);
                dout("flush_dirty_caps %llx.%llx\n", ceph_vinop(inode));
                spin_unlock(&mdsc->cap_dirty_lock);
+               ceph_wait_on_async_create(inode);
                ceph_check_caps(ci, CHECK_CAPS_FLUSH, NULL);
                iput(inode);
                spin_lock(&mdsc->cap_dirty_lock);