mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/7] ext4: correct behaviors under errors=remount-ro mode
@ 2025-01-17  8:23 libaokun
  2025-01-17  8:23 ` [PATCH 1/7] ext4: convert EXT4_FLAGS_* defines to enum libaokun
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: libaokun @ 2025-01-17  8:23 UTC (permalink / raw)
  To: linux-ext4
  Cc: tytso, adilger.kernel, jack, linux-kernel, yi.zhang, yangerkun,
	libaokun, Baokun Li

From: Baokun Li <libaokun1@huawei.com>

After commit d3476f3dad4a ("ext4: don't set SB_RDONLY after filesystem
errors") in v6.12-rc1, the 'errors=remount-ro' mode no longer sets
SB_RDONLY on errors, which results in us seeing the filesystem is still
in rw state after errors.

What's worse is that after commit
  95257987a638 ("ext4: drop EXT4_MF_FS_ABORTED flag")
was merged in v6.6-rc1, the EXT4_FLAGS_SHUTDOWN bit is set in
ext4_handle_error(). This causes the file system to not be read-only
when an error is triggered in "errors=remount-ro" mode, because
EXT4_FLAGS_SHUTDOWN prevents both writing and reading.

This patch set fixes the above behavior change. See the link[1] for the
previous discussion:

Link: https://lore.kernel.org/all/22d652f6-cb3c-43f5-b2fe-0a4bb6516a04@huawei.com [1]

Comments and questions are, as always, welcome.

Thanks,
Baokun

Baokun Li (7):
  ext4: convert EXT4_FLAGS_* defines to enum
  ext4: add EXT4_FLAGS_EMERGENCY_RO bit
  ext4: add ext4_is_emergency() helper function
  ext4: add ext4_sb_rdonly() helper function
  ext4: correct behavior under errors=remount-ro mode
  ext4: show 'emergency_ro' when EXT4_FLAGS_EMERGENCY_RO is set
  ext4: show 'shutdown' hint when ext4 is forced to shutdown

 fs/ext4/ext4.h      | 28 ++++++++++++++++++++---
 fs/ext4/ext4_jbd2.c |  6 +++--
 fs/ext4/file.c      | 26 ++++++++++++++-------
 fs/ext4/fsync.c     | 12 ++++------
 fs/ext4/ialloc.c    |  5 +++--
 fs/ext4/inline.c    |  2 +-
 fs/ext4/inode.c     | 47 +++++++++++++++++++++-----------------
 fs/ext4/ioctl.c     |  2 +-
 fs/ext4/mballoc.c   |  4 ++--
 fs/ext4/mmp.c       |  2 +-
 fs/ext4/namei.c     | 20 ++++++++++-------
 fs/ext4/page-io.c   |  2 +-
 fs/ext4/super.c     | 55 ++++++++++++++++++++++-----------------------
 13 files changed, 126 insertions(+), 85 deletions(-)

-- 
2.39.2


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

end of thread, other threads:[~2025-01-21 14:08 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-17  8:23 [PATCH 0/7] ext4: correct behaviors under errors=remount-ro mode libaokun
2025-01-17  8:23 ` [PATCH 1/7] ext4: convert EXT4_FLAGS_* defines to enum libaokun
2025-01-21 12:07   ` Jan Kara
2025-01-21 12:15     ` Baokun Li
2025-01-17  8:23 ` [PATCH 2/7] ext4: add EXT4_FLAGS_EMERGENCY_RO bit libaokun
2025-01-21 12:08   ` Jan Kara
2025-01-21 12:20     ` Baokun Li
2025-01-17  8:23 ` [PATCH 3/7] ext4: add ext4_is_emergency() helper function libaokun
2025-01-21 12:14   ` Jan Kara
2025-01-21 12:40     ` Baokun Li
2025-01-17  8:23 ` [PATCH 4/7] ext4: add ext4_sb_rdonly() " libaokun
2025-01-21 13:11   ` Jan Kara
2025-01-21 14:08     ` Baokun Li
2025-01-17  8:23 ` [PATCH 5/7] ext4: correct behavior under errors=remount-ro mode libaokun
2025-01-17  8:23 ` [PATCH 6/7] ext4: show 'emergency_ro' when EXT4_FLAGS_EMERGENCY_RO is set libaokun
2025-01-21 13:13   ` Jan Kara
2025-01-17  8:23 ` [PATCH 7/7] ext4: show 'shutdown' hint when ext4 is forced to shutdown libaokun
2025-01-21 13:13   ` Jan Kara

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®