diff options
author | Christoph Hellwig <hch@lst.de> | 2024-05-06 07:20:23 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-05-07 16:29:42 +0300 |
commit | 30f1e724142242a453f92d90b33e030014900bf0 (patch) | |
tree | be11fbd287ea98d07697887c0ad5c484ab4e075b /net | |
parent | 0942592045782e76a9d52c409955c2dc313cbd30 (diff) | |
download | linux-30f1e724142242a453f92d90b33e030014900bf0.tar.xz |
block: move discard checks into the ioctl handler
Most bio operations get basic sanity checking in submit_bio and anything
more complicated than that is done in the callers. Discards are a bit
different from that in that a lot of checking is done in
__blkdev_issue_discard, and the specific errnos for that are returned
to userspace. Move the checks that require specific errnos to the ioctl
handler instead, and just leave the basic sanity checking in submit_bio
for the other handlers. This introduces two changes in behavior:
1) the logical block size alignment check of the start and len is lost
for non-ioctl callers.
This matches what is done for other operations including reads and
writes. We should probably verify this for all bios, but for now
make discards match the normal flow.
2) for non-ioctl callers all errors are reported on I/O completion now
instead of synchronously. Callers in general mostly ignore or log
errors so this will actually simplify the code once cleaned up
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240506042027.2289826-3-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions