[PATCH 0/2] ceph: tell the MDS when a closed file no longer wants Fr or Fw

From: Xiubo Li via B4 Relay

Date: Thu Nov 26 2026 - 23:34:57 EST


A single "tail" of a log file from one client can make the writer of
that file on another client over 1000 times slower, for as long as the
reader keeps the inode cached. This was reported on ceph-users: a
simulation that runs in 38 s took about 15 minutes after one "tail" of
its log from the cluster front end.

After a file opened for reading is closed, we often keep the inode with
only Fr and shared caps issued. These are all caps we retain, and since
commit fdac94fab799 ("ceph: skip updating 'wanted' caps if caps are
already issued") nothing tells the MDS that we no longer want Fr. The
MDS counts us as a user of the file, chooses no loner, and keeps the
filelock in MIX; the writer has no Fb and every write() goes to the
OSDs synchronously. Nothing in MIX revokes our Fr, so it never ends
until the inode is dropped.

Patch 1 sends the cap message when the MDS still has Fr or a write cap
in the 'wanted' mask of a regular file we no longer want. Patch 2
checks such a closed file at caps_wanted_delay_min, like a closed file
holding write caps, instead of at caps_wanted_delay_max. The writer
is back to full speed 60 s after the "tail" with patch 1, and about
10 s after it with both.

The same bug is in libcephfs; its fix and a qa test that fails on both
clients without the fixes are in a ceph pull request.

Link: https://tracker.ceph.com/issues/83627
---
Xiubo Li (2):
ceph: tell the MDS when a closed file no longer wants Fr or Fw
ceph: check the caps of a closed file the MDS thinks we read sooner

fs/ceph/caps.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
---
base-commit: 3f90412e989cb381d4bf96260468f5c7b2d08655
change-id: 20261127-ceph-drop-stale-wanted-44abc0e83728

Best regards,
--
Xiubo Li <xiubo.li@xxxxxxxxx>