]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.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)
committerJos Collin <jcollin@redhat.com>
Fri, 7 Nov 2025 09:01:55 +0000 (14:31 +0530)
commit71fbb9e1c2a77319bd3803f1d20214cb56d549ee
tree7415bac0f92aa3ace4d7568dae7b728382030e1e
parent9dfebec88f893b1b30e889db33d672c5c6ee9bef
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>
(cherry picked from commit d7eca69a5b887e2b65513411280158d06cdb6b3c)
src/client/Client.cc
src/client/Delegation.h
src/client/Inode.cc
src/client/Inode.h