Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/3] btrfs: fix io_uring encoded read cleanup paths
@ 2026-08-05  2:11 Yang Xiuwei
  2026-08-05  2:11 ` [PATCH 1/3] btrfs: unlock inode and extent on pages alloc failure in uring read Yang Xiuwei
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Yang Xiuwei @ 2026-08-05  2:11 UTC (permalink / raw)
  To: Chris Mason, David Sterba; +Cc: linux-btrfs, Mark Harmstone, Yang Xiuwei

Three related bugs in the io_uring ENCODED_READ path:

1. pages array allocation failure returned -ENOMEM without unlocking
   the inode and extent locks taken by btrfs_encoded_read().

2. If bios completed before fill_pages returned, endio already queued
   btrfs_uring_read_finished(), but a negative I/O status made the
   caller clean up as well.  This matches the GPF reported by Yue Sun;
   patch 2 follows Jens Axboe's suggestion.

   Link: https://lore.kernel.org/linux-btrfs/20260630091609.3414-1-samsun1006219@gmail.com/

3. After btrfs_uring_read_extent() failed, the caller skipped
   kfree(data->iov) by always jumping to out_acct.

Yang Xiuwei (3):
  btrfs: unlock inode and extent on pages alloc failure in uring read
  btrfs: always return -EIOCBQUEUED after btrfs_uring_read_extent_endio
  btrfs: free iov when btrfs_uring_read_extent fails

 fs/btrfs/inode.c |  7 +++----
 fs/btrfs/ioctl.c | 18 +++++++++++-------
 2 files changed, 14 insertions(+), 11 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2026-08-05  4:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-05  2:11 [PATCH 0/3] btrfs: fix io_uring encoded read cleanup paths Yang Xiuwei
2026-08-05  2:11 ` [PATCH 1/3] btrfs: unlock inode and extent on pages alloc failure in uring read Yang Xiuwei
2026-08-05  3:19   ` Qu Wenruo
2026-08-05  4:18     ` Yang Xiuwei
2026-08-05  2:11 ` [PATCH 2/3] btrfs: always return -EIOCBQUEUED after btrfs_uring_read_extent_endio Yang Xiuwei
2026-08-05  3:21   ` Qu Wenruo
2026-08-05  4:18     ` Yang Xiuwei
2026-08-05  2:11 ` [PATCH 3/3] btrfs: free iov when btrfs_uring_read_extent fails Yang Xiuwei

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