Skip to content

Commit e485bd9

Browse files
Ming Leiaxboe
authored andcommitted
ublk: fix command op code check
In case of CONFIG_BLKDEV_UBLK_LEGACY_OPCODES, type of cmd opcode could be 0 or 'u'; and type can only be 'u' if CONFIG_BLKDEV_UBLK_LEGACY_OPCODES isn't set. So fix the wrong check. Fixes: 2d786e6 ("block: ublk: switch to ioctl command encoding") Signed-off-by: Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/20230505153142.1258336-1-ming.lei@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 5e6e080 commit e485bd9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/block/ublk_drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,7 @@ static inline int ublk_check_cmd_op(u32 cmd_op)
12811281
{
12821282
u32 ioc_type = _IOC_TYPE(cmd_op);
12831283

1284-
if (IS_ENABLED(CONFIG_BLKDEV_UBLK_LEGACY_OPCODES) && ioc_type != 'u')
1284+
if (!IS_ENABLED(CONFIG_BLKDEV_UBLK_LEGACY_OPCODES) && ioc_type != 'u')
12851285
return -EOPNOTSUPP;
12861286

12871287
if (ioc_type != 'u' && ioc_type != 0)

0 commit comments

Comments
 (0)