All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Keith Busch <kbusch@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
	Christoph Hellwig <hch@infradead.org>,
	Mikulas Patocka <mpatocka@redhat.com>,
	Mike Snitzer <snitzer@kernel.org>
Subject: Re: [PATCH V2] block: fail unaligned bio from submit_bio_noacct()
Date: Tue, 26 Mar 2024 09:19:47 +0800	[thread overview]
Message-ID: <ZgIis4gzth7iCjJf@fedora> (raw)
In-Reply-To: <ZgHIOUpZB78uVxAm@kbusch-mbp.dhcp.thefacebook.com>

On Mon, Mar 25, 2024 at 11:53:45AM -0700, Keith Busch wrote:
> On Sun, Mar 24, 2024 at 09:37:02PM +0800, Ming Lei wrote:
> > @@ -780,6 +793,9 @@ void submit_bio_noacct(struct bio *bio)
> >  		}
> >  	}
> >  
> > +	if (WARN_ON_ONCE(!bio_check_alignment(bio, q)))
> > +		goto end_io;
> > +
> 
> The "status" at this point is "BLK_STS_IOERR", so user space would see
> EIO, but the existing checks return EINVAL. I'm not sure if that's "ok",
> but assuming it is, I think the user visible different behavior should
> be mentioned in the changelog.
> 
> Alternatively, maybe we want an asynchronous way to return EINVAL for

It has to be async way to return it because submit_bio*() returns
void.

> these conditions. It's more informative to a user where the problem is
> than a generic EIO. There is no BLK_STS_ value that translates to
> EINVAL, though, so maybe we need a new block status code like
> BLK_STS_INVALID_REQUEST.

Yeah, I agree, but that is one existed issue. The 'status' should have
been initialized as 'BLK_STS_INVALID_REQUEST' or 'BLK_STS_INVALID' in
submit_bio_noacct(), and all check failure can be thought as -EINVAL.


Thanks, 
Ming


      reply	other threads:[~2024-03-26  1:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-24 13:37 [PATCH V2] block: fail unaligned bio from submit_bio_noacct() Ming Lei
2024-03-24 21:48 ` Mike Snitzer
2024-03-24 23:25 ` Christoph Hellwig
2024-03-25  3:03   ` Ming Lei
2024-03-25  3:12     ` Christoph Hellwig
2024-03-25  3:50       ` Ming Lei
2024-03-25 18:53 ` Keith Busch
2024-03-26  1:19   ` Ming Lei [this message]

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=ZgIis4gzth7iCjJf@fedora \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=hch@infradead.org \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=snitzer@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.