Skip to content

ceph: fix client race conditions with stale r_parent

Alex Markuze ceph-devel lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 2 repliesIn review
  2. v32 patches 2 repliesSuperseded
  3. v22 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches4 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2ceph: fix client race condition validating r_parent before applying statefs/ceph/debugfs.c fs/ceph/dir.c fs/ceph/file.c +3 more+139 -1061 reply
2/2ceph: fix client race condition where r_parent becomes stale before sending messagefs/ceph/inode.c+50 -21 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchViacheslav Dubeyko
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/2] ceph: fix client race conditions with stale r_parent

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(-)
Signature · 1 line
2.34.1