Skip to content

Commit a9c49c6

Browse files
calebsanderkawasaki
authored andcommitted
ublk: consolidate UBLK_IO_FLAG_{ACTIVE,OWNED_BY_SRV} checks
UBLK_IO_FLAG_ACTIVE and UBLK_IO_FLAG_OWNED_BY_SRV are mutually exclusive. So just check that UBLK_IO_FLAG_OWNED_BY_SRV is set in __ublk_ch_uring_cmd(); that implies UBLK_IO_FLAG_ACTIVE is unset. Signed-off-by: Caleb Sander Mateos <[email protected]> Reviewed-by: Ming Lei <[email protected]>
1 parent bb9d08e commit a9c49c6

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/block/ublk_drv.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2210,14 +2210,11 @@ static int __ublk_ch_uring_cmd(struct io_uring_cmd *cmd,
22102210
goto out;
22112211

22122212
/* there is pending io cmd, something must be wrong */
2213-
if (io->flags & UBLK_IO_FLAG_ACTIVE) {
2213+
if (!(io->flags & UBLK_IO_FLAG_OWNED_BY_SRV)) {
22142214
ret = -EBUSY;
22152215
goto out;
22162216
}
22172217

2218-
if (!(io->flags & UBLK_IO_FLAG_OWNED_BY_SRV))
2219-
goto out;
2220-
22212218
/*
22222219
* ensure that the user issues UBLK_IO_NEED_GET_DATA
22232220
* iff the driver have set the UBLK_IO_FLAG_NEED_GET_DATA.

0 commit comments

Comments
 (0)