linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/buffer: fix comments to reflect logical block size
@ 2025-06-17 11:51 Pankaj Raghav
  2025-06-18  1:48 ` Martin K. Petersen
  0 siblings, 1 reply; 3+ messages in thread
From: Pankaj Raghav @ 2025-06-17 11:51 UTC (permalink / raw)
  To: Alexander Viro, Jan Kara, Christian Brauner
  Cc: Martin K . Petersen, linux-fsdevel, linux-kernel, kernel,
	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.

Change it to logical block size to reflect the actual code.

Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
---
 fs/buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index 8cf4a1dc481e..e818125d5c09 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1122,7 +1122,7 @@ __getblk_slow(struct block_device *bdev, sector_t block,
 {
 	bool blocking = gfpflags_allow_blocking(gfp);
 
-	/* Size must be multiple of hard sectorsize */
+	/* Size must be multiple of logical block 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",

base-commit: e04c78d86a9699d136910cfc0bdcf01087e3267e
-- 
2.49.0


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

* Re: [PATCH] fs/buffer: fix comments to reflect logical block size
  2025-06-17 11:51 [PATCH] fs/buffer: fix comments to reflect logical block size Pankaj Raghav
@ 2025-06-18  1:48 ` Martin K. Petersen
  2025-06-18  7:57   ` Pankaj Raghav (Samsung)
  0 siblings, 1 reply; 3+ messages in thread
From: Martin K. Petersen @ 2025-06-18  1:48 UTC (permalink / raw)
  To: Pankaj Raghav
  Cc: Alexander Viro, Jan Kara, Christian Brauner, Martin K . Petersen,
	linux-fsdevel, linux-kernel, kernel


Hi Pankaj!

> -	/* Size must be multiple of hard sectorsize */
> +	/* Size must be multiple of logical block 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",

OK with me. However, maybe that comment should just go away? The code on
the following line articulates the constraint very clearly.

If you tweak things, please fix the spacing for "(bdev)-1".

Either way:

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>

-- 
Martin K. Petersen

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

* Re: [PATCH] fs/buffer: fix comments to reflect logical block size
  2025-06-18  1:48 ` Martin K. Petersen
@ 2025-06-18  7:57   ` Pankaj Raghav (Samsung)
  0 siblings, 0 replies; 3+ messages in thread
From: Pankaj Raghav (Samsung) @ 2025-06-18  7:57 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: Pankaj Raghav, Alexander Viro, Jan Kara, Christian Brauner,
	linux-fsdevel, linux-kernel

On Tue, Jun 17, 2025 at 09:48:50PM -0400, Martin K. Petersen wrote:
> 
> Hi Pankaj!
> 
> > -	/* Size must be multiple of hard sectorsize */
> > +	/* Size must be multiple of logical block 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",
> 
> OK with me. However, maybe that comment should just go away? The code on
> the following line articulates the constraint very clearly.
> 
> If you tweak things, please fix the spacing for "(bdev)-1".

That makes sense. I will send a v2.
> 
> Either way:
> 
> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
> 

Thanks
> -- 
> Martin K. Petersen

-- 
Pankaj Raghav

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

end of thread, other threads:[~2025-06-18  7:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-17 11:51 [PATCH] fs/buffer: fix comments to reflect logical block size Pankaj Raghav
2025-06-18  1:48 ` Martin K. Petersen
2025-06-18  7:57   ` Pankaj Raghav (Samsung)

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).