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