public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Subject: Re: [PATCH 1/2] scsi: sd: Check physical sector alignment of sequential zone writes
Date: Mon, 6 Mar 2023 06:15:56 +0000	[thread overview]
Message-ID: <20230306061555.hgiflebppsca7sq7@shindev> (raw)
In-Reply-To: <5b81a4b6-82b9-55a2-a75c-486886c96e9e@acm.org>

On Mar 04, 2023 / 07:21, Bart Van Assche wrote:
> On 3/3/23 19:03, Damien Le Moal wrote:
> > 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.
> 
> I think that there are other ways to debug software that triggers an
> unaligned write, e.g. ftrace.

I see, then let me drop this patch. I will repost the second patch only for
reviews.

-- 
Shin'ichiro Kawasaki

  reply	other threads:[~2023-03-06  6:16 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
2023-03-04 15:21       ` Bart Van Assche
2023-03-06  6:15         ` Shinichiro Kawasaki [this message]
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=20230306061555.hgiflebppsca7sq7@shindev \
    --to=shinichiro.kawasaki@wdc.com \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=bvanassche@acm.org \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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