From: Klara Modin <klarasmodin@gmail.com>
To: brauner@kernel.org, anuj20.g@samsung.com, arnd@kernel.org
Cc: martin.petersen@oracle.com, joshi.k@samsung.com,
hch@infradead.org, arnd@arndb.de, naresh.kamboju@linaro.org,
anders.roxell@linaro.org, axboe@kernel.dk, kbusch@kernel.org,
csander@purestorage.com, asml.silence@gmail.com,
adobriyan@gmail.com, djwong@kernel.org,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
Klara Modin <klarasmodin@gmail.com>
Subject: [PATCH] block: change blk_get_meta_cap() stub return -ENOIOCTLCMD
Date: Fri, 25 Jul 2025 18:43:34 +0200 [thread overview]
Message-ID: <20250725164334.9606-1-klarasmodin@gmail.com> (raw)
When introduced in commit 9eb22f7fedfc ("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.
Link: https://lore.kernel.org/lkml/CACzX3AsRd__fXb9=CJPTTJC494SDnYAtYrN2=+bZgMCvM6UQDg@mail.gmail.com
Fixes: 42b0ef01e6b5 ("block: fix FS_IOC_GETLBMD_CAP parsing in blkdev_common_ioctl()")
Signed-off-by: Klara Modin <klarasmodin@gmail.com>
---
include/linux/blk-integrity.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/blk-integrity.h b/include/linux/blk-integrity.h
index e04c6e5bf1c6..e67a2b6e8f11 100644
--- a/include/linux/blk-integrity.h
+++ b/include/linux/blk-integrity.h
@@ -97,7 +97,7 @@ static inline struct bio_vec rq_integrity_vec(struct request *rq)
static inline int blk_get_meta_cap(struct block_device *bdev, unsigned int cmd,
struct logical_block_metadata_cap __user *argp)
{
- return -EOPNOTSUPP;
+ return -ENOIOCTLCMD;
}
static inline int blk_rq_count_integrity_sg(struct request_queue *q,
struct bio *b)
base-commit: bc5b0c8febccbeabfefc9b59083b223ec7c7b53a
--
2.50.1
next reply other threads:[~2025-07-25 16:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-25 16:43 Klara Modin [this message]
2025-07-25 17:45 ` Arnd Bergmann
2025-07-29 7:31 ` Christoph Hellwig
2025-07-29 11:19 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250725164334.9606-1-klarasmodin@gmail.com \
--to=klarasmodin@gmail.com \
--cc=adobriyan@gmail.com \
--cc=anders.roxell@linaro.org \
--cc=anuj20.g@samsung.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=csander@purestorage.com \
--cc=djwong@kernel.org \
--cc=hch@infradead.org \
--cc=joshi.k@samsung.com \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=naresh.kamboju@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®