From: DaeMyung Kang <charsyam@gmail.com>
To: Namjae Jeon <linkinjeon@kernel.org>, Hyunchul Lee <hyc.lee@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
DaeMyung Kang <charsyam@gmail.com>
Subject: [PATCH v2 0/3] ntfs: fix mount failure cleanup and free-count setup
Date: Thu, 21 May 2026 19:17:48 +0900 [thread overview]
Message-ID: <20260521101751.591345-1-charsyam@gmail.com> (raw)
In-Reply-To: <20260520170151.4115308-1-charsyam@gmail.com>
Hi Namjae,
This v2 is ported to the Linux kernel tree and is based on current
mainline commit 8bc67e4db64a ("Merge tag 'erofs-for-7.1-rc5-fixes' of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs"). The
patches now modify fs/ntfs/super.c rather than the out-of-tree Github
layout.
The fixes cover mount failure cleanup, a free-cluster precalc allocation
failure path that can otherwise leave waiters blocked forever, and the
$UpCase default-table alias check. Per review, the free-cluster patch
now avoids the temporary file_ra_state heap allocation entirely by using
a stack variable for the synchronous bitmap scan.
Testing:
- For patch 1, I built a DEBUG_KMEMLEAK/DEBUG_FS kernel and injected an
ntfs_fill_super() failure immediately after load_system_files(). Before
the fix, kmemleak reported the leaked volume label allocated from
ntfs_ucstonls(); after the fix, the same failure path produced no
kmemleak report.
- For patch 2, I used QEMU with a debug injection that forces the initial
precalc readahead-state allocation to fail. Before the fix, statfs
remained blocked in D state in ntfs_statfs(). This version removes
that heap allocation and therefore removes the injected failure point.
I also mounted a fresh NTFS image with the stack-backed state and
verified statfs reported the same free count as ntfsinfo -m.
Changes since v1:
- Rebased and regenerated the series for the Linux kernel tree
(fs/ntfs/super.c), instead of the Github out-of-tree layout.
- Changed patch 2 to declare the temporary file_ra_state on the stack,
as suggested by Hyunchul Lee, instead of adding an OOM fallback path.
- Zero-initialized patch 2's on-stack file_ra_state because
file_ra_state_init() only initializes ra_pages and prev_pos.
- Reworded patch 3 to avoid overstating user-visible name comparison
effects, and used memcmp() for the exact $UpCase table comparison.
DaeMyung Kang (3):
ntfs: free volume-wide resources on fill_super failure
ntfs: avoid heap allocation for free-cluster readahead state
ntfs: only alias volume $UpCase to default on exact match
fs/ntfs/super.c | 28 +++++++++-------------------
1 file changed, 9 insertions(+), 19 deletions(-)
base-commit: 8bc67e4db64aa72732c474b44ea8622062c903f0
--
2.43.0
next prev parent reply other threads:[~2026-05-21 10:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 17:01 [PATCH " DaeMyung Kang
2026-05-20 17:01 ` [PATCH 1/3] ntfs: free volume-wide resources on fill_super failure DaeMyung Kang
2026-05-21 1:03 ` Hyunchul Lee
2026-05-20 17:01 ` [PATCH 2/3] ntfs: wake free-cluster waiters when precalc allocation fails DaeMyung Kang
2026-05-21 1:03 ` Hyunchul Lee
2026-05-20 17:01 ` [PATCH 3/3] ntfs: only alias volume $UpCase to default on exact match DaeMyung Kang
2026-05-21 1:04 ` Hyunchul Lee
2026-05-21 1:02 ` [PATCH 0/3] ntfs: fix mount failure cleanup and free-count setup Hyunchul Lee
2026-05-21 10:17 ` DaeMyung Kang [this message]
2026-05-21 10:17 ` [PATCH v2 1/3] ntfs: free volume-wide resources on fill_super failure DaeMyung Kang
2026-05-21 10:17 ` [PATCH v2 2/3] ntfs: avoid heap allocation for free-cluster readahead state DaeMyung Kang
2026-05-21 12:19 ` Namjae Jeon
2026-05-21 12:48 ` CharSyam
2026-05-22 0:00 ` Hyunchul Lee
2026-05-22 0:28 ` Namjae Jeon
2026-05-22 1:22 ` CharSyam
2026-05-22 4:31 ` Namjae Jeon
2026-05-21 10:17 ` [PATCH v2 3/3] ntfs: only alias volume $UpCase to default on exact match DaeMyung Kang
2026-05-21 13:00 ` [PATCH v3 0/3] ntfs: fix mount failure cleanup and free-count setup DaeMyung Kang
2026-05-21 13:00 ` [PATCH v3 1/3] ntfs: free volume-wide resources on fill_super failure DaeMyung Kang
2026-05-21 13:00 ` [PATCH v3 2/3] ntfs: avoid heap allocation for free-cluster readahead state DaeMyung Kang
2026-05-21 13:00 ` [PATCH v3 3/3] ntfs: only alias volume $UpCase to default on exact match DaeMyung Kang
2026-05-23 14:11 ` [PATCH v3 0/3] ntfs: fix mount failure cleanup and free-count setup 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=20260521101751.591345-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