stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 6.14] btrfs: ioctl: error on fixed buffer flag for io-uring cmd
@ 2025-03-26 15:57 Sidong Yang
  2025-03-26 16:03 ` kernel test robot
  2025-03-27 14:58 ` Pavel Begunkov
  0 siblings, 2 replies; 4+ messages in thread
From: Sidong Yang @ 2025-03-26 15:57 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 | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 6c18bad53cd3..62bb9e11e8d6 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -4823,6 +4823,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;
@@ -4959,6 +4965,11 @@ static int btrfs_uring_encoded_write(struct io_uring_cmd *cmd, unsigned int issu
 		goto out_acct;
 	}
 
+	if (cmd->flags & IORING_URING_CMD_FIXED) {
+		ret = -EOPNOTSUPP;
+		goto out_acct;
+	}
+
 	file = cmd->file;
 	sqe_addr = u64_to_user_ptr(READ_ONCE(cmd->sqe->addr));
 
-- 
2.43.0


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

* Re: [PATCH 6.14] btrfs: ioctl: error on fixed buffer flag for io-uring cmd
  2025-03-26 15:57 [PATCH 6.14] btrfs: ioctl: error on fixed buffer flag for io-uring cmd Sidong Yang
@ 2025-03-26 16:03 ` kernel test robot
  2025-03-27 14:58 ` Pavel Begunkov
  1 sibling, 0 replies; 4+ messages in thread
From: kernel test robot @ 2025-03-26 16:03 UTC (permalink / raw)
  To: Sidong Yang; +Cc: stable, oe-kbuild-all

Hi,

Thanks for your patch.

FYI: kernel test robot notices the stable kernel rule is not satisfied.

The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-3

Rule: The upstream commit ID must be specified with a separate line above the commit text.
Subject: [PATCH 6.14] btrfs: ioctl: error on fixed buffer flag for io-uring cmd
Link: https://lore.kernel.org/stable/20250326155736.611445-1-sidong.yang%40furiosa.ai

Please ignore this mail if the patch is not relevant for upstream.

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




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

* Re: [PATCH 6.14] btrfs: ioctl: error on fixed buffer flag for io-uring cmd
  2025-03-26 15:57 [PATCH 6.14] btrfs: ioctl: error on fixed buffer flag for io-uring cmd Sidong Yang
  2025-03-26 16:03 ` kernel test robot
@ 2025-03-27 14:58 ` Pavel Begunkov
  2025-03-27 15:32   ` Sidong Yang
  1 sibling, 1 reply; 4+ messages in thread
From: Pavel Begunkov @ 2025-03-27 14:58 UTC (permalink / raw)
  To: Sidong Yang, Josef Bacik, David Sterba, Mark Harmstone
  Cc: linux-btrfs, linux-kernel, stable, Jens Axboe

On 3/26/25 15:57, Sidong Yang wrote:
> 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.

IIRC, the feature where you use the flag hasn't been merged
yet and is targeting 6.16. In this case you need to send this
patch for 6.15, and once merged stable will try to pick it up
from there.

> 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 | 11 +++++++++++
>   1 file changed, 11 insertions(+)
> 
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 6c18bad53cd3..62bb9e11e8d6 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -4823,6 +4823,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;
> @@ -4959,6 +4965,11 @@ static int btrfs_uring_encoded_write(struct io_uring_cmd *cmd, unsigned int issu
>   		goto out_acct;
>   	}
>   
> +	if (cmd->flags & IORING_URING_CMD_FIXED) {
> +		ret = -EOPNOTSUPP;
> +		goto out_acct;
> +	}
> +
>   	file = cmd->file;
>   	sqe_addr = u64_to_user_ptr(READ_ONCE(cmd->sqe->addr));
>   

-- 
Pavel Begunkov


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

* Re: [PATCH 6.14] btrfs: ioctl: error on fixed buffer flag for io-uring cmd
  2025-03-27 14:58 ` Pavel Begunkov
@ 2025-03-27 15:32   ` Sidong Yang
  0 siblings, 0 replies; 4+ messages in thread
From: Sidong Yang @ 2025-03-27 15:32 UTC (permalink / raw)
  To: Pavel Begunkov
  Cc: Josef Bacik, David Sterba, Mark Harmstone, linux-btrfs,
	linux-kernel, stable, Jens Axboe

On Thu, Mar 27, 2025 at 02:58:11PM +0000, Pavel Begunkov wrote:
> On 3/26/25 15:57, Sidong Yang wrote:
> > 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.
> 
> IIRC, the feature where you use the flag hasn't been merged
> yet and is targeting 6.16. In this case you need to send this
> patch for 6.15, and once merged stable will try to pick it up
> from there.

Thanks, I mistakenly thought the feature would be merged in 6.15. If so,
I need send this for 6.15 after sending the patch for the fixed buffer feature.

> 
> > 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 | 11 +++++++++++
> >   1 file changed, 11 insertions(+)
> > 
> > diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> > index 6c18bad53cd3..62bb9e11e8d6 100644
> > --- a/fs/btrfs/ioctl.c
> > +++ b/fs/btrfs/ioctl.c
> > @@ -4823,6 +4823,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;
> > @@ -4959,6 +4965,11 @@ static int btrfs_uring_encoded_write(struct io_uring_cmd *cmd, unsigned int issu
> >   		goto out_acct;
> >   	}
> > +	if (cmd->flags & IORING_URING_CMD_FIXED) {
> > +		ret = -EOPNOTSUPP;
> > +		goto out_acct;
> > +	}
> > +
> >   	file = cmd->file;
> >   	sqe_addr = u64_to_user_ptr(READ_ONCE(cmd->sqe->addr));
> 
> -- 
> Pavel Begunkov
> 

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

end of thread, other threads:[~2025-03-27 15:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-26 15:57 [PATCH 6.14] btrfs: ioctl: error on fixed buffer flag for io-uring cmd Sidong Yang
2025-03-26 16:03 ` kernel test robot
2025-03-27 14:58 ` Pavel Begunkov
2025-03-27 15:32   ` Sidong Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).