This is a note to let you know that I've just added the patch titled ceph: wait on async create before checking caps for syncfs to the 5.18-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ceph-wait-on-async-create-before-checking-caps-for-syncfs.patch and it can be found in the queue-5.18 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 8692969e9164c15474b356b9898e5b9b21a85643 Mon Sep 17 00:00:00 2001 From: Jeff Layton <jlayton@xxxxxxxxxx> Date: Mon, 6 Jun 2022 19:31:42 -0400 Subject: ceph: wait on async create before checking caps for syncfs From: Jeff Layton <jlayton@xxxxxxxxxx> commit 8692969e9164c15474b356b9898e5b9b21a85643 upstream. 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@xxxxxxxxxxxxxxx URL: https://tracker.ceph.com/issues/55823 Fixes: fbed7045f552 ("ceph: wait for async create reply before sending any cap messages") Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx> Reviewed-by: Xiubo Li <xiubli@xxxxxxxxxx> Signed-off-by: Ilya Dryomov <idryomov@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/ceph/caps.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -4358,6 +4358,7 @@ static void flush_dirty_session_caps(str 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); Patches currently in stable-queue which might be from jlayton@xxxxxxxxxx are queue-5.18/ceph-wait-on-async-create-before-checking-caps-for-syncfs.patch