From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
To: Lalit Shankar Chowdhury <lalitshankarch@gmail.com>
Cc: <ntfs3@lists.linux.dev>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fs/ntfs3: Use wait_on_buffer() directly
Date: Tue, 9 Dec 2025 14:38:06 +0100 [thread overview]
Message-ID: <2dd18e34-4cff-402e-8077-e6e7e1fce2bf@paragon-software.com> (raw)
In-Reply-To: <20251128101256.283353-1-lalitshankarch@gmail.com>
On 11/28/25 11:12, Lalit Shankar Chowdhury wrote:
> wait_on_buffer() checks buffer_locked() internally
> before calling __wait_on_buffer().
>
> Signed-off-by: Lalit Shankar Chowdhury <lalitshankarch@gmail.com>
> ---
> fs/ntfs3/fsntfs.c | 15 ++++-----------
> fs/ntfs3/index.c | 4 +---
> fs/ntfs3/super.c | 4 +---
> 3 files changed, 6 insertions(+), 17 deletions(-)
>
> diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c
> index c7a2f191254d..a6c155c691d6 100644
> --- a/fs/ntfs3/fsntfs.c
> +++ b/fs/ntfs3/fsntfs.c
> @@ -875,9 +875,7 @@ void ntfs_update_mftmirr(struct ntfs_sb_info *sbi, int wait)
> return;
> }
>
> - if (buffer_locked(bh2))
> - __wait_on_buffer(bh2);
> -
> + wait_on_buffer(bh2);
> lock_buffer(bh2);
> memcpy(bh2->b_data, bh1->b_data, blocksize);
> set_buffer_uptodate(bh2);
> @@ -1069,9 +1067,7 @@ int ntfs_sb_write(struct super_block *sb, u64 lbo, size_t bytes,
> return -ENOMEM;
> }
>
> - if (buffer_locked(bh))
> - __wait_on_buffer(bh);
> -
> + wait_on_buffer(bh);
> lock_buffer(bh);
> if (buf) {
> memcpy(bh->b_data + off, buf, op);
> @@ -1347,8 +1343,7 @@ int ntfs_get_bh(struct ntfs_sb_info *sbi, const struct runs_tree *run, u64 vbo,
> err = -ENOMEM;
> goto out;
> }
> - if (buffer_locked(bh))
> - __wait_on_buffer(bh);
> + wait_on_buffer(bh);
> set_buffer_uptodate(bh);
> } else {
> bh = ntfs_bread(sb, block);
> @@ -1420,9 +1415,7 @@ int ntfs_write_bh(struct ntfs_sb_info *sbi, struct NTFS_RECORD_HEADER *rhdr,
> if (op > bytes)
> op = bytes;
>
> - if (buffer_locked(bh))
> - __wait_on_buffer(bh);
> -
> + wait_on_buffer(bh);
> lock_buffer(bh);
>
> bh_data = bh->b_data + off;
> diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c
> index 6d1bf890929d..763fc05d3ca7 100644
> --- a/fs/ntfs3/index.c
> +++ b/fs/ntfs3/index.c
> @@ -252,9 +252,7 @@ static int bmp_buf_get(struct ntfs_index *indx, struct ntfs_inode *ni,
>
> bbuf->bh = bh;
>
> - if (buffer_locked(bh))
> - __wait_on_buffer(bh);
> -
> + wait_on_buffer(bh);
> lock_buffer(bh);
>
> sb = sbi->sb;
> diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
> index ddff94c091b8..bb6462d5569c 100644
> --- a/fs/ntfs3/super.c
> +++ b/fs/ntfs3/super.c
> @@ -1616,9 +1616,7 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)
> */
> struct buffer_head *bh0 = sb_getblk(sb, 0);
> if (bh0) {
> - if (buffer_locked(bh0))
> - __wait_on_buffer(bh0);
> -
> + wait_on_buffer(bh0);
> lock_buffer(bh0);
> memcpy(bh0->b_data, boot2, sizeof(*boot2));
> set_buffer_uptodate(bh0);
Applied to my tree, thanks for the patch. Regards, Konstantin
prev parent reply other threads:[~2025-12-09 13:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-28 10:12 [PATCH] fs/ntfs3: Use wait_on_buffer() directly Lalit Shankar Chowdhury
2025-12-09 13:38 ` Konstantin Komarov [this message]
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=2dd18e34-4cff-402e-8077-e6e7e1fce2bf@paragon-software.com \
--to=almaz.alexandrovich@paragon-software.com \
--cc=lalitshankarch@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--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