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] [thread-next>] [day] [month] [year] [list]
Message-ID: <ns6d42ddh5m3tl3sxessebn6fjpydif6kjnjte6yrmogeahzux@5ssovrkhpnrz>
Date: Wed, 16 Apr 2025 11:33:11 +0200
From: Jan Kara <jack@...e.cz>
To: Davidlohr Bueso <dave@...olabs.net>
Cc: jack@...e.cz, tytso@....edu, adilger.kernel@...ger.ca, 
	brauner@...nel.org, mcgrof@...nel.org, willy@...radead.org, hare@...e.de, 
	djwong@...nel.org, linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org, 
	linux-mm@...ck.org
Subject: Re: [PATCH 2/7] fs/buffer: introduce sleeping flavors for pagecache
 lookups

On Tue 15-04-25 16:16:30, Davidlohr Bueso wrote:
> Add __find_get_block_nonatomic() and sb_find_get_block_nonatomic()
> calls for which users will be converted where safe. These versions
> will take the folio lock instead of the mapping's private_lock.
> 
> Signed-off-by: Davidlohr Bueso <dave@...olabs.net>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@...e.cz>

								Honza

> ---
>  fs/buffer.c                 | 9 +++++++++
>  include/linux/buffer_head.h | 8 ++++++++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/fs/buffer.c b/fs/buffer.c
> index c72ebff1b3f0..64034638ee2c 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -1414,6 +1414,15 @@ __find_get_block(struct block_device *bdev, sector_t block, unsigned size)
>  }
>  EXPORT_SYMBOL(__find_get_block);
>  
> +/* same as __find_get_block() but allows sleeping contexts */
> +struct buffer_head *
> +__find_get_block_nonatomic(struct block_device *bdev, sector_t block,
> +			   unsigned size)
> +{
> +	return find_get_block_common(bdev, block, size, false);
> +}
> +EXPORT_SYMBOL(__find_get_block_nonatomic);
> +
>  /**
>   * bdev_getblk - Get a buffer_head in a block device's buffer cache.
>   * @bdev: The block device.
> diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
> index f0a4ad7839b6..c791aa9a08da 100644
> --- a/include/linux/buffer_head.h
> +++ b/include/linux/buffer_head.h
> @@ -222,6 +222,8 @@ void __wait_on_buffer(struct buffer_head *);
>  wait_queue_head_t *bh_waitq_head(struct buffer_head *bh);
>  struct buffer_head *__find_get_block(struct block_device *bdev, sector_t block,
>  			unsigned size);
> +struct buffer_head *__find_get_block_nonatomic(struct block_device *bdev,
> +			sector_t block, unsigned size);
>  struct buffer_head *bdev_getblk(struct block_device *bdev, sector_t block,
>  		unsigned size, gfp_t gfp);
>  void __brelse(struct buffer_head *);
> @@ -397,6 +399,12 @@ sb_find_get_block(struct super_block *sb, sector_t block)
>  	return __find_get_block(sb->s_bdev, block, sb->s_blocksize);
>  }
>  
> +static inline struct buffer_head *
> +sb_find_get_block_nonatomic(struct super_block *sb, sector_t block)
> +{
> +	return __find_get_block_nonatomic(sb->s_bdev, block, sb->s_blocksize);
> +}
> +
>  static inline void
>  map_bh(struct buffer_head *bh, struct super_block *sb, sector_t block)
>  {
> -- 
> 2.39.5
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ