From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
To: Baolin Liu <liubaolin12138@163.com>
Cc: <ntfs3@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
<liubaolin12138@gmail.com>, Baolin Liu <liubaolin@kylinos.cn>
Subject: Re: [PATCH] fs/ntfs3: check wnd_set_used() in ntfs_look_free_mft()
Date: Wed, 11 Nov 2026 09:48:03 +0100 [thread overview]
Message-ID: <d0647e5c-0b78-4ca3-8ab2-8ff0ab6ab7e7@paragon-software.com> (raw)
In-Reply-To: <20260805073615.2044614-1-liubaolin12138@163.com>
On 8/5/26 09:36, Baolin Liu wrote:
> From: Baolin Liu <liubaolin@kylinos.cn>
>
> wnd_set_used() can fail, but ntfs_look_free_mft() ignored
> the error and could return success after leaving the MFT
> bitmap unmarked.
>
> Check the return value and unwind the new subrecord on failure.
>
> Signed-off-by: Baolin Liu <liubaolin@kylinos.cn>
> ---
> fs/ntfs3/fsntfs.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c
> index d0434756029b..ab9e03156cce 100644
> --- a/fs/ntfs3/fsntfs.c
> +++ b/fs/ntfs3/fsntfs.c
> @@ -741,10 +741,19 @@ int ntfs_look_free_mft(struct ntfs_sb_info *sbi, CLST *rno, bool mft,
> }
>
> /* We have found a record that are not reserved for next MFT. */
> - if (*rno >= MFT_REC_FREE)
> - wnd_set_used(wnd, *rno, 1);
> - else if (*rno >= MFT_REC_RESERVED && sbi->mft.reserved_bitmap_inited)
> + if (*rno >= MFT_REC_FREE) {
> + err = wnd_set_used(wnd, *rno, 1);
> + if (err) {
> + if (ni) {
> + ni_remove_mi(ni, *mi);
> + mi_put(*mi);
> + *mi = NULL;
> + }
> + goto out;
> + }
> + } else if (*rno >= MFT_REC_RESERVED && sbi->mft.reserved_bitmap_inited) {
> __set_bit(*rno - MFT_REC_RESERVED, &sbi->mft.reserved_bitmap);
> + }
>
> out:
> if (!mft)
Hello,
Sorry for the delay.
Your patch is applied, thank you.
Regards,
Konstantin
next prev parent reply other threads:[~2026-11-11 8:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 7:36 Baolin Liu
2026-11-11 8:48 ` Konstantin Komarov [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-08-05 7:35 Baolin Liu
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=d0647e5c-0b78-4ca3-8ab2-8ff0ab6ab7e7@paragon-software.com \
--to=almaz.alexandrovich@paragon-software.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liubaolin12138@163.com \
--cc=liubaolin12138@gmail.com \
--cc=liubaolin@kylinos.cn \
--cc=ntfs3@lists.linux.dev \
/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
all inboxes | Powered by JetHome®