mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: Swarna Prabhu <sw.prabhu6@gmail.com>
Cc: James.Bottomley@hansenpartnership.com,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org, mcgrof@kernel.org,
	pankaj.raghav@linux.dev, bvanassche@acm.org, dlemoal@kernel.org,
	Swarna Prabhu <s.prabhu@samsung.com>
Subject: Re: [PATCH 2/2] scsi: scsi_debug: enable sdebug_sector_size > PAGE_SIZE
Date: Mon, 2 Mar 2026 12:37:34 +0000	[thread overview]
Message-ID: <4323fdd3-8007-4fcb-b90a-1956a47883bb@oracle.com> (raw)
In-Reply-To: <aaWCI69aQAWEgjv7@5163NRD-SPRABHU.ssi.samsung.com>

On 02/03/2026 12:27, Swarna Prabhu wrote:
>>>> PAGE_SIZE in scsi_debug.
>> Surely the sd driver or block layer should be catching non-compliant HW,
>> right?
> Yes, the sd driver and block layer will catch any non compliant HW.
>> The scsi_debug driver should minic HW, and there is nothing in any SCSI
>> specs which mentions that the sector size needs to be limited to 64KB or the
>> like - am I correct? The useful thing about scsi_debug is that we can
>> pretend to be broken* HW and see if the upper layers catch it.
>>
>> *broken for Linux or non-compliant wrt spec
>>
> As you pointed, the SCSI spec doesn't restrict the sector size to be
> limited to 64 KiB. Earlier block layer had limitations on block size
> upto PAGE_SIZE. With that limitation being addressed and sd driver
> change, sd driver and block layer can handle large block sizes
> correctly. By allowing large sector size on scsi debug we allow
> emulation of spec compliant HW.

Sure, so is there any reason to have those checks in scsi_debug at all? 
Would removing them break that driver and be unsafe?

Thanks,
John

> 
>>> Reviewed-by: Damien Le Moal<dlemoal@kernel.org>
>>> Signed-off-by: Swarna Prabhu<s.prabhu@samsung.com>
>>> ---
>>>    drivers/scsi/scsi_debug.c | 8 +-------
>>>    1 file changed, 1 insertion(+), 7 deletions(-)
>>>
>>> diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
>>> index c947655db518..4c6feee87f05 100644
>>> --- a/drivers/scsi/scsi_debug.c
>>> +++ b/drivers/scsi/scsi_debug.c
>>> @@ -8495,13 +8495,7 @@ 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 (blk_validate_block_size(sdebug_sector_size)) {
>>>    		pr_err("invalid sector_size %d\n", sdebug_sector_size);
>>>    		return -EINVAL;


  reply	other threads:[~2026-03-02 12:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19  4:37 [PATCH v4 0/2] enable sector size > PAGE_SIZE for scsi sw.prabhu6
2026-02-19  4:37 ` [PATCH 1/2] scsi: sd: enable sector size > PAGE_SIZE in scsi sd driver sw.prabhu6
2026-03-01  1:49   ` Martin K. Petersen
2026-02-19  4:37 ` [PATCH 2/2] scsi: scsi_debug: enable sdebug_sector_size > PAGE_SIZE sw.prabhu6
2026-02-27  8:35   ` John Garry
2026-03-02 12:27     ` Swarna Prabhu
2026-03-02 12:37       ` John Garry [this message]
2026-02-27  3:09 ` [PATCH v4 0/2] enable sector size > PAGE_SIZE for scsi Swarna Prabhu
2026-03-11  2:06 ` (subset) " Martin K. Petersen
  -- strict thread matches above, loose matches on Subject: below --
2026-02-11  1:50 [PATCH v2 " sw.prabhu6
2026-02-11  1:50 ` [PATCH 2/2] scsi: scsi_debug: enable sdebug_sector_size > PAGE_SIZE sw.prabhu6
2025-12-10  1:41 [v1 0/2] enable sector size > PAGE_SIZE for scsi sw.prabhu6
2025-12-10  1:41 ` [PATCH 2/2] scsi: scsi_debug: enable sdebug_sector_size > PAGE_SIZE sw.prabhu6

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=4323fdd3-8007-4fcb-b90a-1956a47883bb@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=bvanassche@acm.org \
    --cc=dlemoal@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mcgrof@kernel.org \
    --cc=pankaj.raghav@linux.dev \
    --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®