lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2dd18e34-4cff-402e-8077-e6e7e1fce2bf@paragon-software.com>
Date: Tue, 9 Dec 2025 14:38:06 +0100
From: Konstantin Komarov <almaz.alexandrovich@...agon-software.com>
To: Lalit Shankar Chowdhury <lalitshankarch@...il.com>
CC: <ntfs3@...ts.linux.dev>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] fs/ntfs3: Use wait_on_buffer() directly

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@...il.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ