linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] fs/buffer: remove comment about hard sectorsize
@ 2025-06-18  7:58 Pankaj Raghav
  2025-06-18 10:26 ` Daniel Gomez
  2025-06-19 10:07 ` Christian Brauner
  0 siblings, 2 replies; 3+ messages in thread
From: Pankaj Raghav @ 2025-06-18  7:58 UTC (permalink / raw)
  To: Alexander Viro, Jan Kara, Christian Brauner
  Cc: kernel, linux-fsdevel, linux-kernel, Martin K . Petersen,
	Pankaj Raghav

Commit e1defc4ff0cf ("block: Do away with the notion of hardsect_size")
changed hardsect_size to logical block size. The comment on top still
says hardsect_size.

Remove the comment as the code is pretty clear. While we are at it,
format the relevant code.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
---
 fs/buffer.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index 8cf4a1dc481e..a14d281c6a74 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1122,9 +1122,8 @@ __getblk_slow(struct block_device *bdev, sector_t block,
 {
 	bool blocking = gfpflags_allow_blocking(gfp);
 
-	/* Size must be multiple of hard sectorsize */
-	if (unlikely(size & (bdev_logical_block_size(bdev)-1) ||
-			(size < 512 || size > PAGE_SIZE))) {
+	if (unlikely(size & (bdev_logical_block_size(bdev) - 1) ||
+		     (size < 512 || size > PAGE_SIZE))) {
 		printk(KERN_ERR "getblk(): invalid block size %d requested\n",
 					size);
 		printk(KERN_ERR "logical block size: %d\n",

base-commit: e04c78d86a9699d136910cfc0bdcf01087e3267e
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] fs/buffer: remove comment about hard sectorsize
  2025-06-18  7:58 [PATCH v2] fs/buffer: remove comment about hard sectorsize Pankaj Raghav
@ 2025-06-18 10:26 ` Daniel Gomez
  2025-06-19 10:07 ` Christian Brauner
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Gomez @ 2025-06-18 10:26 UTC (permalink / raw)
  To: Pankaj Raghav, Alexander Viro, Jan Kara, Christian Brauner
  Cc: kernel, linux-fsdevel, linux-kernel, Martin K . Petersen

On 18/06/2025 09.58, Pankaj Raghav wrote:
> Commit e1defc4ff0cf ("block: Do away with the notion of hardsect_size")
> changed hardsect_size to logical block size. The comment on top still
> says hardsect_size.
> 
> Remove the comment as the code is pretty clear. While we are at it,
> format the relevant code.
> 
> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> ---
>  fs/buffer.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/buffer.c b/fs/buffer.c
> index 8cf4a1dc481e..a14d281c6a74 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -1122,9 +1122,8 @@ __getblk_slow(struct block_device *bdev, sector_t block,
>  {
>  	bool blocking = gfpflags_allow_blocking(gfp);
>  
> -	/* Size must be multiple of hard sectorsize */
> -	if (unlikely(size & (bdev_logical_block_size(bdev)-1) ||
> -			(size < 512 || size > PAGE_SIZE))) {
> +	if (unlikely(size & (bdev_logical_block_size(bdev) - 1) ||
> +		     (size < 512 || size > PAGE_SIZE))) {

Nit: Would it make sense to use SECTOR_SIZE here instead of the hard-coded 512?

>  		printk(KERN_ERR "getblk(): invalid block size %d requested\n",
>  					size);
>  		printk(KERN_ERR "logical block size: %d\n",
> 
> base-commit: e04c78d86a9699d136910cfc0bdcf01087e3267e

Reviewed-by: Daniel Gomez <da.gomez@samsung.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] fs/buffer: remove comment about hard sectorsize
  2025-06-18  7:58 [PATCH v2] fs/buffer: remove comment about hard sectorsize Pankaj Raghav
  2025-06-18 10:26 ` Daniel Gomez
@ 2025-06-19 10:07 ` Christian Brauner
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Brauner @ 2025-06-19 10:07 UTC (permalink / raw)
  To: Alexander Viro, Jan Kara, Pankaj Raghav
  Cc: Christian Brauner, kernel, linux-fsdevel, linux-kernel,
	Martin K . Petersen

On Wed, 18 Jun 2025 09:58:21 +0200, Pankaj Raghav wrote:
> Commit e1defc4ff0cf ("block: Do away with the notion of hardsect_size")
> changed hardsect_size to logical block size. The comment on top still
> says hardsect_size.
> 
> Remove the comment as the code is pretty clear. While we are at it,
> format the relevant code.
> 
> [...]

Applied to the vfs-6.17.misc branch of the vfs/vfs.git tree.
Patches in the vfs-6.17.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-6.17.misc

[1/1] fs/buffer: remove comment about hard sectorsize
      https://git.kernel.org/vfs/vfs/c/6ae58121126d

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-19 10:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-18  7:58 [PATCH v2] fs/buffer: remove comment about hard sectorsize Pankaj Raghav
2025-06-18 10:26 ` Daniel Gomez
2025-06-19 10:07 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).