mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-12 12:25:18 +02:00
ubd: untagle discard vs write zeroes not support handling
[ Upstream commit31ade7d4fd
] Discard and Write Zeroes are different operation and implemented by different fallocate opcodes for ubd. If one fails the other one can work and vice versa. Split the code to disable the operations in ubd_handler to only disable the operation that actually failed. Fixes:50109b5a03
("um: Add support for DISCARD in the UBD Driver") Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com> Link: https://lore.kernel.org/r/20240531074837.1648501-3-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
3236c24532
commit
1cfdfb965e
|
@ -458,10 +458,11 @@ static int bulk_req_safe_read(
|
||||||
|
|
||||||
static void ubd_end_request(struct io_thread_req *io_req)
|
static void ubd_end_request(struct io_thread_req *io_req)
|
||||||
{
|
{
|
||||||
if (io_req->error == BLK_STS_NOTSUPP &&
|
if (io_req->error == BLK_STS_NOTSUPP) {
|
||||||
req_op(io_req->req) == REQ_OP_DISCARD) {
|
if (req_op(io_req->req) == REQ_OP_DISCARD)
|
||||||
blk_queue_max_discard_sectors(io_req->req->q, 0);
|
blk_queue_max_discard_sectors(io_req->req->q, 0);
|
||||||
blk_queue_max_write_zeroes_sectors(io_req->req->q, 0);
|
else if (req_op(io_req->req) == REQ_OP_WRITE_ZEROES)
|
||||||
|
blk_queue_max_write_zeroes_sectors(io_req->req->q, 0);
|
||||||
}
|
}
|
||||||
blk_mq_end_request(io_req->req, io_req->error);
|
blk_mq_end_request(io_req->req, io_req->error);
|
||||||
kfree(io_req);
|
kfree(io_req);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user