Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH 6.13] btrfs: ioctl: error on fixed buffer flag for io-uring cmd
@ 2025-03-26 16:03 Sidong Yang
  2025-03-26 16:07 ` kernel test robot
  2025-03-26 17:55 ` Sasha Levin
  0 siblings, 2 replies; 3+ messages in thread
From: Sidong Yang @ 2025-03-26 16:03 UTC (permalink / raw)
  To: Josef Bacik, David Sterba, Mark Harmstone
  Cc: linux-btrfs, linux-kernel, stable, Jens Axboe, Pavel Begunkov,
	Sidong Yang

Currently, the io-uring fixed buffer cmd flag is silently dismissed,
even though it does not work. This patch returns an error when the flag
is set, making it clear that operation is not supported.

Fixes: 34310c442e17 ("btrfs: add io_uring command for encoded reads (ENCODED_READ ioctl)")
Cc: stable@vger.kernel.org
Signed-off-by: Sidong Yang <sidong.yang@furiosa.ai>
---
 fs/btrfs/ioctl.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 4d9305fa37a8..98d99f2f7926 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -4906,6 +4906,12 @@ static int btrfs_uring_encoded_read(struct io_uring_cmd *cmd, unsigned int issue
 		ret = -EPERM;
 		goto out_acct;
 	}
+
+	if (cmd->flags & IORING_URING_CMD_FIXED) {
+		ret = -EOPNOTSUPP;
+		goto out_acct;
+	}
+
 	file = cmd->file;
 	inode = BTRFS_I(file->f_inode);
 	fs_info = inode->root->fs_info;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-26 17:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-26 16:03 [PATCH 6.13] btrfs: ioctl: error on fixed buffer flag for io-uring cmd Sidong Yang
2025-03-26 16:07 ` kernel test robot
2025-03-26 17:55 ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox