From: Caleb Sander Mateos Date: Thu, 19 Jun 2025 19:27:45 +0000 (-0600) Subject: btrfs: don't skip accounting in early ENOTTY return in btrfs_uring_encoded_read() X-Git-Tag: v6.16.2~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e0a8165b21028ed80b59f2ee8362192688272229;p=thirdparty%2Fkernel%2Fstable.git 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 Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 8a60983a697c6..36e485d845308 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -4829,7 +4829,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;