]> 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)
committerJos Collin <jcollin@redhat.com>
Thu, 5 Mar 2026 10:15:39 +0000 (15:45 +0530)
commita1c34127cb3ef6cfc4e323a24207daf03725249a
treeb994ab04e2ff78efdad1c8e42b8e4d7f5d66d626
parent70f8415b300f041766fa27faf7d5472699e32388
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