mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v9 0/4] ntfs: fix volume flag races and persist the recorded error state
@ 2026-09-11  2:09 Hongling Zeng
  2026-09-11  2:09 ` [PATCH v9 1/4] ntfs: fix volume flag update races Hongling Zeng
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Hongling Zeng @ 2026-09-11  2:09 UTC (permalink / raw)
  To: linkinjeon, hyc.lee; +Cc: ntfs, linux-kernel, zhongling0719, Hongling Zeng

The fs/ntfs runtime metadata-corruption paths only record the in-memory
NVolErrors() flag, and the caller-side dirty-bit marking races with
ntfs_sync_fs(): a volume can end up with a clean on-disk dirty flag
despite modification or recorded corruption, so chkdsk never runs on
the next mount.  Based on ntfs/ntfs-next (9a05b5715cfa).

 1/4 makes the volume flag read-modify-write atomic under the
    $Volume mrec_lock;
 2/4 marks the volume dirty unconditionally on metadata changes,
    dropping the racy caller-side checks in file.c and namei.c;
 3/4 derives the on-disk dirty bit from the recorded error state at
    the persistence points (sync_fs, remount-ro, put_super) and never
    writes a hibernated volume;
 4/4 persists the dirty state after the final put_super() commits so
    late errors cannot unmount clean.

Changes since v8:
 - 2/4 also converts the setattr and fallocate callers, which were
   missed; the IOCB_NOWAIT non-blocking marking moves to a separate
   follow-up;
 - 3/4 removes the then-unreferenced ntfs_clear_volume_flags().

Hongling Zeng (4):
  ntfs: fix volume flag update races
  ntfs: set the volume dirty bit unconditionally on metadata changes
  ntfs: sync the volume dirty bit with the recorded error state
  ntfs: persist the dirty state after the final put_super() commits

 fs/ntfs/file.c   |  20 ++---
 fs/ntfs/namei.c  |  24 ++----
 fs/ntfs/ntfs.h   |   1 -
 fs/ntfs/super.c  | 191 ++++++++++++++++++++++++++++++++++++-----------
 fs/ntfs/volume.h |   4 +
 5 files changed, 171 insertions(+), 69 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2026-09-14  2:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11  2:09 [PATCH v9 0/4] ntfs: fix volume flag races and persist the recorded error state Hongling Zeng
2026-09-11  2:09 ` [PATCH v9 1/4] ntfs: fix volume flag update races Hongling Zeng
2026-09-11  2:09 ` [PATCH v9 2/4] ntfs: set the volume dirty bit unconditionally on metadata changes Hongling Zeng
2026-09-13  8:31   ` liubaolin
2026-09-14  1:52     ` dd
2026-09-11  2:09 ` [PATCH v9 3/4] ntfs: sync the volume dirty bit with the recorded error state Hongling Zeng
2026-09-13 13:46   ` liubaolin
2026-09-14  2:06     ` dd
2026-09-11  2:09 ` [PATCH v9 4/4] ntfs: persist the dirty state after the final put_super() commits Hongling Zeng

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®