Skip to content

Commit 1edaac3

Browse files
klarasmtorvalds
authored andcommitted
block: change blk_get_meta_cap() stub return -ENOIOCTLCMD
When introduced in commit 9eb22f7 ("fs: add ioctl to query metadata and protection info capabilities") the stub of blk_get_meta_cap() for !BLK_DEV_INTEGRITY always returns -EOPNOTSUPP. The motivation was that while the command was unsupported in that configuration it was still recognized. A later change instead assumed -ENOIOCTLCMD as is required for unknown ioctl commands per Documentation/driver-api/ioctl.rst. The result being that on !BLK_DEV_INTEGRITY configs, any ioctl which reaches blkdev_common_ioctl() will return -EOPNOTSUPP. Change the stub to return -ENOIOCTLCMD, fixing the issue and better matching with expectations. [ The blkdev_common_ioctl() confusion has been fixed, but -ENOIOCTLCMD is the right thing to return for unrecognized ioctls, so the patch remains the right thing to do. - Linus ] Link: https://lore.kernel.org/lkml/CACzX3AsRd__fXb9=CJPTTJC494SDnYAtYrN2=+bZgMCvM6UQDg@mail.gmail.com Fixes: 42b0ef0 ("block: fix FS_IOC_GETLBMD_CAP parsing in blkdev_common_ioctl()") Signed-off-by: Klara Modin <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 595d7eb commit 1edaac3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/blk-integrity.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static inline struct bio_vec rq_integrity_vec(struct request *rq)
9797
static inline int blk_get_meta_cap(struct block_device *bdev, unsigned int cmd,
9898
struct logical_block_metadata_cap __user *argp)
9999
{
100-
return -EOPNOTSUPP;
100+
return -ENOIOCTLCMD;
101101
}
102102
static inline int blk_rq_count_integrity_sg(struct request_queue *q,
103103
struct bio *b)

0 commit comments

Comments
 (0)