From: DaeMyung Kang <charsyam@gmail.com>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: Hyunchul Lee <hyc.lee@gmail.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 0/2] ntfs: super.c fixes for MFT mirror check and sync_fs
Date: Mon, 11 May 2026 02:11:13 +0900 [thread overview]
Message-ID: <20260510171115.368494-1-charsyam@gmail.com> (raw)
This series fixes two regressions in fs/ntfs/super.c introduced by:
6251f0b0de7d ("ntfs: update super block operations")
which switched the driver to the fs_context-based mount API and added
->sync_fs.
Patch 1 restores the missing memcmp() inside check_mft_mirror(). The
function still walks both $MFT and $MFTMirr records and computes a
per-record byte count to compare, but the actual comparison was dropped
when super block operations were updated. As a result, mount silently
accepts a stale or inconsistent $MFTMirr as long as both records pass
the structural baad-record checks, defeating the purpose of having the
mirror. With the comparison restored, a mismatch is reported at mount
time and the existing on_errors policy decides whether to convert to
read-only or proceed with NVolErrors set.
Patch 2 stops ntfs_sync_fs() from clearing VOLUME_IS_DIRTY. sync_fs
can be called while the filesystem is still mounted read-write (for
example via sync(2) or periodic writeback), so clearing the dirty bit
there marks the volume clean before the mount lifetime has ended. If
the system crashes after sync_fs() but before unmount or remount-ro,
the on-disk image is left looking cleanly shut down even though it is
not. The legitimate clear paths in ntfs_put_super() and the RW->RO
remount path are kept intact and gate on !NVolErrors().
Both patches apply on top of ntfs-next.
DaeMyung Kang (2):
ntfs: restore $MFT mirror contents check
ntfs: do not mark the volume clean from sync_fs
fs/ntfs/super.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
--
2.43.0
next reply other threads:[~2026-05-10 17:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-10 17:11 DaeMyung Kang [this message]
2026-05-10 17:11 ` [PATCH 1/2] ntfs: restore $MFT mirror contents check DaeMyung Kang
2026-05-11 14:31 ` Namjae Jeon
2026-05-10 17:11 ` [PATCH 2/2] ntfs: do not mark the volume clean from sync_fs DaeMyung Kang
2026-05-11 2:58 ` Namjae Jeon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260510171115.368494-1-charsyam@gmail.com \
--to=charsyam@gmail.com \
--cc=hyc.lee@gmail.com \
--cc=linkinjeon@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox