diff options
| author | Caleb Sander Mateos <csander@purestorage.com> | 2025-06-19 13:27:45 -0600 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-08-20 18:36:31 +0200 |
| commit | 2556c76192d9e094accfc8187f437bc065c52bef (patch) | |
| tree | eca1f775aab37c4faa4a3591b5359cec258a3530 | |
| parent | ba9c85d2e74c8ccf4ef33c92f3354863009ae990 (diff) | |
| download | linux-2556c76192d9e094accfc8187f437bc065c52bef.tar.gz linux-2556c76192d9e094accfc8187f437bc065c52bef.tar.bz2 linux-2556c76192d9e094accfc8187f437bc065c52bef.zip | |
btrfs: don't skip accounting in early ENOTTY return in btrfs_uring_encoded_read()
commit ea124ec327086325fc096abf42837dac471ac7ae upstream.
btrfs_uring_encoded_read() returns early with -ENOTTY if the uring_cmd
is issued with IO_URING_F_COMPAT but the kernel doesn't support compat
syscalls. However, this early return bypasses the syscall accounting.
Go to out_acct instead to ensure the syscall is counted.
Fixes: 34310c442e17 ("btrfs: add io_uring command for encoded reads (ENCODED_READ ioctl)")
CC: stable@vger.kernel.org # 6.15+
Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | fs/btrfs/ioctl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index b70ef4455610..d250a658eab8 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -4832,7 +4832,8 @@ static int btrfs_uring_encoded_read(struct io_uring_cmd *cmd, unsigned int issue #if defined(CONFIG_64BIT) && defined(CONFIG_COMPAT) copy_end = offsetofend(struct btrfs_ioctl_encoded_io_args_32, flags); #else - return -ENOTTY; + ret = -ENOTTY; + goto out_acct; #endif } else { copy_end = copy_end_kernel; |
