linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Gomez <da.gomez@kernel.org>
To: Pankaj Raghav <p.raghav@samsung.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
	Christian Brauner <brauner@kernel.org>
Cc: kernel@pankajraghav.com, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH v2] fs/buffer: remove comment about hard sectorsize
Date: Wed, 18 Jun 2025 12:26:47 +0200	[thread overview]
Message-ID: <6a4eb76e-a203-4be1-9816-09c25b76db4b@kernel.org> (raw)
In-Reply-To: <20250618075821.111459-1-p.raghav@samsung.com>

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>

  reply	other threads:[~2025-06-18 10:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-18  7:58 [PATCH v2] fs/buffer: remove comment about hard sectorsize Pankaj Raghav
2025-06-18 10:26 ` Daniel Gomez [this message]
2025-06-19 10:07 ` Christian Brauner

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=6a4eb76e-a203-4be1-9816-09c25b76db4b@kernel.org \
    --to=da.gomez@kernel.org \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=kernel@pankajraghav.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=p.raghav@samsung.com \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).