ocfs2: convert remaining read-only checks to ocfs2_emergency_state
authorAhmet Eray Karadag <eraykrdg1@gmail.com>
Wed, 3 Dec 2025 03:34:26 +0000 (06:34 +0300)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 11 Dec 2025 00:07:43 +0000 (16:07 -0800)
commit7eff54dfd245fb4bf398334be663478b9ae4bb99
tree04a3e0dd3e0c80452932b0976975c7bc4aeec6d2
parent752ba0976b25d69cfac55137573298bd5dd88aa2
ocfs2: convert remaining read-only checks to ocfs2_emergency_state

Now that the centralized `ocfs2_emergency_state()` helper is available,
refactor remaining filesystem-wide checks for `ocfs2_is_soft_readonly` and
`ocfs2_is_hard_readonly` to use this new function.

To ensure strict consistency with the previous behavior and guarantee no
functional changes, the call sites continue to explicitly return -EROFS
when the emergency state is detected.  This standardizes the check logic
while preserving the existing error handling flow.

Link: https://lkml.kernel.org/r/3421641b54ad6b6e4ffca052351b518eacc1bd08.1764728893.git.eraykrdg1@gmail.com
Co-developed-by: Albin Babu Varghese <albinbabuvarghese20@gmail.com>
Signed-off-by: Albin Babu Varghese <albinbabuvarghese20@gmail.com>
Signed-off-by: Ahmet Eray Karadag <eraykrdg1@gmail.com>
Reviewed-by: Heming Zhao <heming.zhao@suse.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: David Hunter <david.hunter.linux@gmail.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Mark Fasheh <mark@fasheh.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/buffer_head_io.c
fs/ocfs2/file.c
fs/ocfs2/inode.c
fs/ocfs2/move_extents.c
fs/ocfs2/resize.c
fs/ocfs2/super.c