From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: Bart Van Assche <bvanassche@acm.org>,
Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
linux-scsi@vger.kernel.org,
"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Subject: Re: [PATCH 1/2] scsi: sd: Check physical sector alignment of sequential zone writes
Date: Sat, 4 Mar 2023 12:03:07 +0900 [thread overview]
Message-ID: <23ac3205-d92a-b32f-d0e3-29604cf859cd@opensource.wdc.com> (raw)
In-Reply-To: <8be7cebf-a5dc-4742-1ef2-207d1797f2f3@acm.org>
On 3/4/23 03:03, Bart Van Assche wrote:
> On 3/2/23 17:44, Shin'ichiro Kawasaki wrote:
>> + if (sdkp->device->type == TYPE_ZBC && blk_rq_zone_is_seq(rq) &&
>> + (req_op(rq) == REQ_OP_WRITE || req_op(rq) == REQ_OP_ZONE_APPEND) &&
>> + (!IS_ALIGNED(blk_rq_pos(rq), pb_sectors) ||
>> + !IS_ALIGNED(blk_rq_sectors(rq), pb_sectors))) {
>> + scmd_printk(KERN_ERR, cmd,
>> + "Sequential write request not aligned to the physical block size\n");
>> + goto fail;
>> + }
>
> I vote -1 for this patch because my opinion is that we should not
> duplicate checks that must be performed by the storage controller anyway
> inside the sd driver.
Sure, the drive will fail this request, so the end result is the same. But what
is the point of issuing such unaligned request that we know will fail ? The
error message also make it easier to debug as it clarifies that this is not a
write pointer violation. So while this change is not critical, it does have
merits in my opinion.
>
> Thanks,
>
> Bart.
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2023-03-04 3:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-03 1:44 [PATCH 0/2] scsi: sd: Fix physical block size issues of host-managed zoned disks Shin'ichiro Kawasaki
2023-03-03 1:44 ` [PATCH 1/2] scsi: sd: Check physical sector alignment of sequential zone writes Shin'ichiro Kawasaki
2023-03-03 5:34 ` kernel test robot
2023-03-03 6:44 ` Damien Le Moal
2023-03-03 8:57 ` Johannes Thumshirn
2023-03-03 18:03 ` Bart Van Assche
2023-03-04 3:03 ` Damien Le Moal [this message]
2023-03-04 15:21 ` Bart Van Assche
2023-03-06 6:15 ` Shinichiro Kawasaki
2023-03-06 7:58 ` Johannes Thumshirn
2023-03-03 1:44 ` [PATCH 2/2] scsi: sd: Fix wrong zone_write_granularity value at revalidate Shin'ichiro Kawasaki
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=23ac3205-d92a-b32f-d0e3-29604cf859cd@opensource.wdc.com \
--to=damien.lemoal@opensource.wdc.com \
--cc=bvanassche@acm.org \
--cc=johannes.thumshirn@wdc.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=shinichiro.kawasaki@wdc.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