]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
client: adjust `Fb` cap ref count check during synchronous fsync()
authorVenky Shankar <vshankar@redhat.com>
Mon, 29 Sep 2025 06:41:23 +0000 (06:41 +0000)
committerVenky Shankar <vshankar@redhat.com>
Mon, 29 Sep 2025 10:35:31 +0000 (16:05 +0530)
commitd7eca69a5b887e2b65513411280158d06cdb6b3c
treed471ff189b8fe2593675cbe11d4a2e21e22d76a5
parentd15ad83924688362ce36206b1620a6dc53dacdc1
client: adjust `Fb` cap ref count check during synchronous fsync()

cephfs client holds a ref on Fb caps when handing out a write delegation[0].
As fsync from (Ganesha) client holding write delegation will block indefinitely[1]
waiting for cap ref for Fb to drop to 0, which will never happen until the
delegation is returned/recalled.

[0]: https://github.com/ceph/ceph/blob/main/src/client/Delegation.cc#L71
[1]: https://github.com/ceph/ceph/blob/main/src/client/Client.cc#L12438

If an inode has been write delegated, adjust for cap reference count
check in fsync().

Note: This only workls for synchronous fsync() since `client_lock` is
held for the entire duration of the call (at least till the patch leading
upto the reference count check). Asynchronous fsync() needs to be fixed
separately (as that can drop `client_lock`).

Fixes: https://tracker.ceph.com/issues/73298
Signed-off-by: Venky Shankar <vshankar@redhat.com>
src/client/Client.cc
src/client/Delegation.h
src/client/Inode.cc
src/client/Inode.h