]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: don't skip accounting in early ENOTTY return in btrfs_uring_encoded_read()
authorCaleb Sander Mateos <csander@purestorage.com>
Thu, 19 Jun 2025 19:27:45 +0000 (13:27 -0600)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jul 2025 22:05:30 +0000 (00:05 +0200)
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>
fs/btrfs/ioctl.c

index 4be09b4152f69e71f4bfa35e588805d8336c137f..a48028ead359dfd40d8e2cc7a48ad8d543802cf7 100644 (file)
@@ -4825,7 +4825,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;