mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4 0/2] ceph: fix client race conditions with stale r_parent
@ 2025-08-12  9:57 Alex Markuze
  2025-08-12  9:57 ` [PATCH v4 1/2] ceph: fix client race condition validating r_parent before applying state Alex Markuze
  2025-08-12  9:57 ` [PATCH v4 2/2] ceph: fix client race condition where r_parent becomes stale before sending message Alex Markuze
  0 siblings, 2 replies; 5+ messages in thread
From: Alex Markuze @ 2025-08-12  9:57 UTC (permalink / raw)
  To: ceph-devel; +Cc: linux-kernel, Slava.Dubeyko, idryomov, Alex Markuze

This patch series addresses client-side race conditions in the Ceph filesystem
where the cached parent directory inode (r_parent) can become stale during
concurrent operations like rename, leading to incorrect state application.

The first patch adds validation during reply processing to ensure the cached
parent directory inode matches the directory info in MDS replies. It refactors
the path building API to use a structured approach and prevents applying state
changes to incorrect directory inodes.

The second patch addresses cases where r_parent becomes stale between request
creation and message sending when the parent directory's i_rwsem is not locked.
It validates that r_parent matches the encoded parent inode and updates to the
correct inode if a mismatch is detected, with appropriate warnings for this

Alex Markuze (2):
  ceph: fix client race condition validating r_parent before applying
    state
  ceph: fix client race condition where r_parent becomes stale before
    sending message

 fs/ceph/debugfs.c    |  14 ++--
 fs/ceph/dir.c        |  17 ++---
 fs/ceph/file.c       |  24 +++----
 fs/ceph/inode.c      |  59 ++++++++++++++--
 fs/ceph/mds_client.c | 165 ++++++++++++++++++++++++++-----------------
 fs/ceph/mds_client.h |  18 +++--
 6 files changed, 189 insertions(+), 108 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-08-13 17:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-12  9:57 [PATCH v4 0/2] ceph: fix client race conditions with stale r_parent Alex Markuze
2025-08-12  9:57 ` [PATCH v4 1/2] ceph: fix client race condition validating r_parent before applying state Alex Markuze
2025-08-13 17:56   ` Viacheslav Dubeyko
2025-08-12  9:57 ` [PATCH v4 2/2] ceph: fix client race condition where r_parent becomes stale before sending message Alex Markuze
2025-08-13 17:56   ` Viacheslav Dubeyko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®