[PATCH v3 0/5] ceph/libceph: killable sync waits and faster recovery after network disruption

From: Ionut Nechita

Date: Mon Nov 23 2026 - 03:09:54 EST


When the Ceph daemons become unreachable for a long time (seen during
Rook-Ceph rolling upgrades with active CephFS I/O), the kernel client
leaves sync(2) and syncfs(2) stuck in an unkillable D state, keeps
backing off on a purely local connect() error, and can miss the mdsmap
update that carries the new MDS address.

1 libceph: fixed 100ms retry instead of exponential backoff when
connect() fails locally with EADDRNOTAVAIL
2-3 make the sync(2)/syncfs(2) waits in ceph_mdsc_sync() and
ceph_osdc_sync() killable
4 request a full mdsmap when an MDS keeps faulting or a session
goes HUNG
5 don't escalate the monitor hunt backoff on EADDRNOTAVAIL

Changes since v2 (thanks, Alex):
- 2/7 and 3/7 no longer bound the waits by mount_timeout, because
sync(2) ignores the ->sync_fs() return value and would return with
metadata still unsafe. The waits are now killable instead: an
un-killed sync still waits for everything, the task can be killed,
and the hung task detector no longer fires. The wait_caps_flush()
diagnostic loop is kept.
- Dropped "ceph: bound the safe-completion wait in
ceph_lock_wait_for_completion()". That wait is already killable
upstream, and a timeout can return before a lock grant is installed
locally.
- Dropped "ceph: set default timeout for MDS requests" (Slava's
Reviewed-by goes with it). ceph_mdsc_wait_request() has been
killable since aa91647c898d ("ceph: make mds requests killable, not
interruptible"), so it doesn't trigger the hung task detector. A
default timeout would only turn MDS outages into -ETIMEDOUT for
applications, and for file locks (the interrupt request as well as
non-blocking F_SETLK) it can leave a lock granted on the MDS but not
installed locally.
- Rebased on next-20261120.

Built with W=1 and sparse, and bisected build by build. Not run
against a live cluster.

I used an LLM to help rebase the series, review the code and draft
the changelogs. I have reviewed every change and take responsibility
for it.

v2: https://lore.kernel.org/all/20261120073431.53636-1-ionut.nechita@xxxxxxxxxxxxx/
v1: https://lore.kernel.org/all/20260312081619.40854-1-ionut.nechita@xxxxxxxxxxxxx/

Ionut Nechita (5):
libceph: don't back off exponentially on EADDRNOTAVAIL
ceph: make the ceph_mdsc_sync() waits killable
ceph: make the ceph_osdc_sync() wait killable
ceph: request a full mdsmap when an MDS stays unreachable
libceph: don't escalate monitor hunt backoff on EADDRNOTAVAIL

fs/ceph/mds_client.c | 85 +++++++++++++++++++++++++++++----
fs/ceph/mds_client.h | 4 +-
fs/ceph/super.c | 9 ++--
include/linux/ceph/messenger.h | 7 +++
include/linux/ceph/osd_client.h | 2 +-
net/ceph/messenger.c | 15 ++++--
net/ceph/mon_client.c | 8 ++++
net/ceph/osd_client.c | 9 +++-
8 files changed, 119 insertions(+), 20 deletions(-)


base-commit: 909ef7a9a30fa139e69e555e3606680f5cca7726
--
2.56.0