* [PATCH] ublk: remove redundant zone op check in ublk_setup_iod()
@ 2025-09-23 15:52 Caleb Sander Mateos
2025-09-24 11:46 ` Ming Lei
2025-09-24 11:48 ` Jens Axboe
0 siblings, 2 replies; 3+ messages in thread
From: Caleb Sander Mateos @ 2025-09-23 15:52 UTC (permalink / raw)
To: Ming Lei, Jens Axboe; +Cc: Caleb Sander Mateos, linux-block, linux-kernel
ublk_setup_iod() checks first whether the request is a zoned operation
issued to a device without zoned support and returns BLK_STS_IOERR if
so. However, such a request would already hit the default case in the
subsequent switch statement and fail the ublk_queue_is_zoned() check,
which also results in a return of BLK_STS_IOERR. So remove the redundant
early check for unsupported zone ops.
Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
---
drivers/block/ublk_drv.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
index 5ab7ff5f03f4..fcc8b3868137 100644
--- a/drivers/block/ublk_drv.c
+++ b/drivers/block/ublk_drv.c
@@ -1103,17 +1103,12 @@ static inline unsigned int ublk_req_build_flags(struct request *req)
static blk_status_t ublk_setup_iod(struct ublk_queue *ubq, struct request *req)
{
struct ublksrv_io_desc *iod = ublk_get_iod(ubq, req->tag);
struct ublk_io *io = &ubq->ios[req->tag];
- enum req_op op = req_op(req);
u32 ublk_op;
- if (!ublk_queue_is_zoned(ubq) &&
- (op_is_zone_mgmt(op) || op == REQ_OP_ZONE_APPEND))
- return BLK_STS_IOERR;
-
switch (req_op(req)) {
case REQ_OP_READ:
ublk_op = UBLK_IO_OP_READ;
break;
case REQ_OP_WRITE:
--
2.45.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ublk: remove redundant zone op check in ublk_setup_iod()
2025-09-23 15:52 [PATCH] ublk: remove redundant zone op check in ublk_setup_iod() Caleb Sander Mateos
@ 2025-09-24 11:46 ` Ming Lei
2025-09-24 11:48 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Ming Lei @ 2025-09-24 11:46 UTC (permalink / raw)
To: Caleb Sander Mateos; +Cc: Jens Axboe, linux-block, linux-kernel
On Tue, Sep 23, 2025 at 09:52:48AM -0600, Caleb Sander Mateos wrote:
> ublk_setup_iod() checks first whether the request is a zoned operation
> issued to a device without zoned support and returns BLK_STS_IOERR if
> so. However, such a request would already hit the default case in the
> subsequent switch statement and fail the ublk_queue_is_zoned() check,
> which also results in a return of BLK_STS_IOERR. So remove the redundant
> early check for unsupported zone ops.
>
> Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Thanks,
Ming
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ublk: remove redundant zone op check in ublk_setup_iod()
2025-09-23 15:52 [PATCH] ublk: remove redundant zone op check in ublk_setup_iod() Caleb Sander Mateos
2025-09-24 11:46 ` Ming Lei
@ 2025-09-24 11:48 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2025-09-24 11:48 UTC (permalink / raw)
To: Ming Lei, Caleb Sander Mateos; +Cc: linux-block, linux-kernel
On Tue, 23 Sep 2025 09:52:48 -0600, Caleb Sander Mateos wrote:
> ublk_setup_iod() checks first whether the request is a zoned operation
> issued to a device without zoned support and returns BLK_STS_IOERR if
> so. However, such a request would already hit the default case in the
> subsequent switch statement and fail the ublk_queue_is_zoned() check,
> which also results in a return of BLK_STS_IOERR. So remove the redundant
> early check for unsupported zone ops.
>
> [...]
Applied, thanks!
[1/1] ublk: remove redundant zone op check in ublk_setup_iod()
commit: f85e254b51aeadf8dc367aaf2fbd2c20378f75c2
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-24 11:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-23 15:52 [PATCH] ublk: remove redundant zone op check in ublk_setup_iod() Caleb Sander Mateos
2025-09-24 11:46 ` Ming Lei
2025-09-24 11:48 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox