mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: liubaolin <liubaolin12138@163.com>
To: Xuewen Wang <wangxuewen@kylinos.cn>,
	linkinjeon@kernel.org, hyc.lee@gmail.com
Cc: ntfs@lists.linux.dev, linux-kernel@vger.kernel.org,
	Baolin Liu <liubaolin@kylinos.cn>
Subject: Re: [PATCH v1 3/4] ntfs: wait for the bitmap scan before MFT bitmap extension
Date: Thu, 24 Sep 2026 10:26:43 +0800	[thread overview]
Message-ID: <ae989750-e61a-41e5-a7fa-dfef870679a6@163.com> (raw)
In-Reply-To: <20260924014514.1678828-4-wangxuewen@kylinos.cn>



在 2026/9/24 09:45, Xuewen Wang 写道:
> If MFT bitmap extension fails before the initial $Bitmap scan completes,
> rollback calls ntfs_bitmap_clear_bit(), which holds a folio lock while
> ntfs_set_lcn_empty_bits() waits for the scan. The scanner deadlocks if it
> still needs that folio.
> 
> Wait for the initial scan before taking the runlist or bitmap folio locks
> and attempting allocation.
> 
> Fixes: 11ccc9107dc4 ("ntfs: update runlist handling and cluster allocator")
> Reviewed-by: Baolin Liu <liubaolin@kylinos.cn>
> Signed-off-by: Xuewen Wang <wangxuewen@kylinos.cn>
> ---
>   fs/ntfs/mft.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c
> index 12666668a80e..489a5935202c 100644
> --- a/fs/ntfs/mft.c
> +++ b/fs/ntfs/mft.c
> @@ -1352,6 +1352,10 @@ static int ntfs_mft_bitmap_extend_allocation_nolock(struct ntfs_volume *vol)
>   	size_t new_rl_count;
>   
>   	ntfs_debug("Extending mft bitmap allocation.");
> +	/* The initial bitmap scan must finish before we lock or change a folio. */
> +	if (!NVolFreeClusterKnown(vol))
> +		wait_event(vol->free_waitq, NVolFreeClusterKnown(vol));
> +
>   	mft_ni = NTFS_I(vol->mft_ino);
>   	mftbmp_ni = NTFS_I(vol->mftbmp_ino);
>   	/*

Looks good to me.

Reviewed-by: Baolin Liu <liubaolin@kylinos.cn>


  reply	other threads:[~2026-09-24  2:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24  1:45 [PATCH v1 0/4] ntfs: fix MFT bitmap extension allocation Xuewen Wang
2026-09-24  1:45 ` [PATCH v1 1/4] ntfs: bound the adjacent cluster in MFT bitmap extension Xuewen Wang
2026-09-24  2:26   ` liubaolin
2026-09-24  1:45 ` [PATCH v1 2/4] ntfs: fix rollback after MFT bitmap run coalescing Xuewen Wang
2026-09-24  2:26   ` liubaolin
2026-09-24  1:45 ` [PATCH v1 3/4] ntfs: wait for the bitmap scan before MFT bitmap extension Xuewen Wang
2026-09-24  2:26   ` liubaolin [this message]
2026-09-24  1:45 ` [PATCH v1 4/4] ntfs: account for direct MFT bitmap cluster allocation Xuewen Wang
2026-09-24  2:26   ` liubaolin
2026-09-24  2:10 ` [PATCH v1 0/4] ntfs: fix MFT bitmap extension allocation liubaolin

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=ae989750-e61a-41e5-a7fa-dfef870679a6@163.com \
    --to=liubaolin12138@163.com \
    --cc=hyc.lee@gmail.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liubaolin@kylinos.cn \
    --cc=ntfs@lists.linux.dev \
    --cc=wangxuewen@kylinos.cn \
    /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®