mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: sw.prabhu6@gmail.com, James.Bottomley@HansenPartnership.com,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, mcgrof@kernel.org,
	kernel@pankajraghav.com, Swarna Prabhu <s.prabhu@samsung.com>
Subject: Re: [PATCH 2/2] scsi: enable sector_size > PAGE_SIZE
Date: Tue, 2 Dec 2025 14:30:19 -1000	[thread overview]
Message-ID: <401d8de5-63a8-461a-bc54-5b2986779a88@acm.org> (raw)
In-Reply-To: <20251202021522.188419-4-sw.prabhu6@gmail.com>

On 12/1/25 4:15 PM, sw.prabhu6@gmail.com wrote:
> diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
> index b2ab97be5db3..b5839e62d3bb 100644
> --- a/drivers/scsi/scsi_debug.c
> +++ b/drivers/scsi/scsi_debug.c
> @@ -8459,13 +8459,8 @@ static int __init scsi_debug_init(void)
>   	} else if (sdebug_ndelay > 0)
>   		sdebug_jdelay = JDELAY_OVERRIDDEN;
>   
> -	switch (sdebug_sector_size) {
> -	case  512:
> -	case 1024:
> -	case 2048:
> -	case 4096:
> -		break;
> -	default:
> +	if (sdebug_sector_size < 512 || sdebug_sector_size > BLK_MAX_BLOCK_SIZE ||
> +	    !is_power_of_2(sdebug_sector_size)) {
>   		pr_err("invalid sector_size %d\n", sdebug_sector_size);
>   		return -EINVAL;
>   	}
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index c3502fcba1bb..f2eac79d7263 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -2889,10 +2889,8 @@ sd_read_capacity(struct scsi_disk *sdkp, struct queue_limits *lim,
>   			  "assuming 512.\n");
>   	}
>   
> -	if (sector_size != 512 &&
> -	    sector_size != 1024 &&
> -	    sector_size != 2048 &&
> -	    sector_size != 4096) {
> +	if (sector_size < 512 || sector_size > BLK_MAX_BLOCK_SIZE ||
> +	    !is_power_of_2(sector_size)) {
>   		sd_printk(KERN_NOTICE, sdkp, "Unsupported sector size %d.\n",
>   			  sector_size);
>   		/*

Please reorganize this patch series into one patch for the scsi_debug
driver and another patch for the sd driver.

Thanks,

Bart.

  reply	other threads:[~2025-12-03  0:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-02  2:15 [RFC PATCH 0/2] enable sector size > PAGE_SIZE for scsi sw.prabhu6
2025-12-02  2:15 ` [PATCH 1/2] scsi: fix write_same16 and write_same10 for sector size > PAGE_SIZE sw.prabhu6
2025-12-03  0:28   ` Bart Van Assche
2025-12-03  0:55     ` Swarna Prabhu
2025-12-02  2:15 ` [PATCH 2/2] scsi: enable sector_size " sw.prabhu6
2025-12-03  0:30   ` Bart Van Assche [this message]
2025-12-03  0:56     ` Swarna Prabhu

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=401d8de5-63a8-461a-bc54-5b2986779a88@acm.org \
    --to=bvanassche@acm.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=kernel@pankajraghav.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mcgrof@kernel.org \
    --cc=s.prabhu@samsung.com \
    --cc=sw.prabhu6@gmail.com \
    /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

all inboxes | Powered by JetHome®