Skip to content

ocfs2: Refactor read-only checks to use ocfs2_emergency_state

Ahmet Eray Karadag lkml ocfs2-devel 4 versions – Applied

Status from this message: [merged mm-nonmm-stable] ocfs2-convert-remaining-read-only-checks-to-ocfs2_emergency_state.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 2 repliesApplied 2/2
  2. v32 patches 6 repliesSuperseded
  3. v22 patches 2 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches4 repliesSuperseded

Patches in v4 All 2 applied

#Subject and filesSizeRepliesApplied
1/2ocfs2: Add ocfs2_emergency_state helper and apply to setattrfs/ocfs2/file.c fs/ocfs2/ocfs2.h+24 -01 replyApplied
2/2ocfs2: Convert remaining read-only checks to ocfs2_emergency_statefs/ocfs2/buffer_head_io.c fs/ocfs2/file.c fs/ocfs2/inode.c +3 more+10 -111 replyApplied

Reviews trailers per patch

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

PatchHeming ZhaoJoseph Qi
1/2R-b R-b
2/2R-b R-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] ocfs2: Refactor read-only checks to use ocfs2_emergency_state

Hi all,

Following the fix for the make_bad_inode validation failure (syzbot ID:
b93b65ee321c97861072), this separate series introduces a new helper function, ocfs2_emergency_state(), to improve and centralize read-only and error state checking.

This is modeled after the ext4_emergency_state() pattern, providing a single, unified location for checking all filesystem-level emergency conditions. This makes the code cleaner and ensures that any future checks (e.g., for fatal error states) can be added in one place.

This series is structured as follows:

1. The first patch introduces the ocfs2_emergency_state() helper (currently checking for -EROFS) and applies it to ocfs2_setattr to provide a "fail-fast" mechanism, as suggested by Albin Babu Varghese.
2. The second patch completes the refactoring by converting all remaining read-only checks throughout OCFS2 to use this new helper.

Previous-link: https://lore.kernel.org/all/[email protected]/

Ahmet Eray Karadag (2):
ocfs2: Add ocfs2_emergency_state helper and apply to setattr
ocfs2: Convert remaining read-only checks to ocfs2_emergency_state

 fs/ocfs2/buffer_head_io.c |  2 +-
 fs/ocfs2/file.c           | 14 ++++++++++----
 fs/ocfs2/inode.c          |  3 +--
 fs/ocfs2/move_extents.c   |  2 +-
 fs/ocfs2/ocfs2.h          | 18 ++++++++++++++++++
 fs/ocfs2/resize.c         |  4 ++--
 fs/ocfs2/super.c          |  2 +-
 7 files changed, 34 insertions(+), 11 deletions(-)
Signature · 1 line
2.43.0