| From: |
| Alex Markuze <amarkuze-AT-redhat.com> |
| To: |
| ceph-devel-AT-vger.kernel.org |
| Subject: |
| [PATCH v1 0/10] ceph: add manual client reset and selftests |
| Date: |
| Fri, 27 Mar 2026 14:30:36 +0000 |
| Message-ID: |
| <20260327143045.1393612-1-amarkuze@redhat.com> |
| Cc: |
| idryomov-AT-gmail.com, linux-fsdevel-AT-vger.kernel.org, amarkuze-AT-redhat.com, vdubeyko-AT-redhat.com |
| Archive-link: |
| Article |
Manual client reset gives operators a way to break client/MDS capability
ownership stalemates without unmounting the client. The reset blocks new
metadata work, gives dirty state a bounded chance to drain, asks each MDS
to close the session, and then tears the local sessions down so the client
can rebuild clean state.
The debugfs interface in this series is only the control surface used to
develop and validate the reset flow. It is not the core feature, and the
long-term intent is to have the client trigger the reset automatically
when it detects the stuck condition.
A reconnect-only reset would require MDS support for accepting reconnects
outside the normal MDS RECONNECT phase. Because that support does not
exist today, the series first wires up the reconnect-based worker for
validation and then switches the recovery path over to direct session
teardown.
I split the work into smaller reviewable steps so the preparatory cleanup
lands first, then the reset framework and control path, then the initial
worker, then the direct-teardown refinements, and finally the single-client
selftests and validation harness.
Patch breakdown:
- 1/10 converts the Ceph inode flags to named bit positions and keeps the
file-lock error bit ready for atomic bitops.
- 2/10 adds a bounded wait and diagnostics to wait_caps_flush().
- 3/10 adds reset state tracking and blocks new metadata requests and lock
acquisition while reset is in progress.
- 4/10 adds the manual reset debugfs control surface, status reporting
plumbing, scheduling hooks, and tracepoints.
- 5/10 adds the initial reconnect-based reset worker and the reconnect
completion tracking needed by that worker.
- 6/10 switches reset recovery from reconnect to direct session teardown.
- 7/10 adds the explicit reset state machine, bounded drain phase, and
richer status reporting.
- 8/10 removes reconnect bookkeeping left behind by the direct-teardown
design.
- 9/10 queues CEPH_SESSION_REQUEST_CLOSE before the forced teardown so
the MDS can release state immediately.
- 10/10 adds the single-client stress, corner-case, and validation tests
used to exercise the reset flow, and passes the configured debugfs root
through the validation wrapper so child scripts observe the same client
namespace.
Alex Markuze (10):
ceph: convert inode flags to named bit positions
ceph: add bounded timeout and diagnostics to wait_caps_flush()
ceph: add client reset state and request gating
ceph: add manual reset debugfs control and trace plumbing
ceph: implement reconnect-based manual reset worker
ceph: replace reconnect with direct session teardown in manual reset
ceph: add reset state machine, drain phase, and status reporting
ceph: drop reset reconnect bookkeeping after direct teardown switch
ceph: send SESSION_REQUEST_CLOSE before forced teardown in manual
reset
ceph: add single-client reset selftests and validation harness
fs/ceph/caps.c | 7 +
fs/ceph/debugfs.c | 172 ++++-
fs/ceph/file.c | 2 +-
fs/ceph/locks.c | 24 +-
fs/ceph/mds_client.c | 630 +++++++++++++++-
fs/ceph/mds_client.h | 38 +-
fs/ceph/super.h | 60 +-
include/trace/events/ceph.h | 60 ++
tools/testing/selftests/filesystems/Makefile | 1 +
.../selftests/filesystems/ceph/HOWTO.md | 121 +++
.../selftests/filesystems/ceph/Makefile | 6 +
.../selftests/filesystems/ceph/README.md | 40 +
.../filesystems/ceph/reset_corner_cases.sh | 707 ++++++++++++++++++
.../filesystems/ceph/reset_stress.sh | 682 +++++++++++++++++
.../filesystems/ceph/run_validation.sh | 317 ++++++++
.../filesystems/ceph/validate_consistency.py | 291 +++++++
16 files changed, 3105 insertions(+), 53 deletions(-)
create mode 100644 tools/testing/selftests/filesystems/ceph/HOWTO.md
create mode 100644 tools/testing/selftests/filesystems/ceph/Makefile
create mode 100644 tools/testing/selftests/filesystems/ceph/README.md
create mode 100755 tools/testing/selftests/filesystems/ceph/reset_corner_cases.sh
create mode 100755 tools/testing/selftests/filesystems/ceph/reset_stress.sh
create mode 100755 tools/testing/selftests/filesystems/ceph/run_validation.sh
create mode 100755 tools/testing/selftests/filesystems/ceph/validate_consistency.py
--
2.34.1