Re: [RFC PATCH v2 2/6] btrfs: untrack i_rwsem before io_uring encoded read completion
From: Peng Huang
Date: Tue Dec 01 2026 - 12:41:40 EST
On Tue, Dec 01, 2026 at 12:40:51AM -0800, Christoph Hellwig wrote:
> I only see patch 2 on the btrfs list, so something got really messed up
> in your patch sending.
Sorry, I used per-patch --cc-cmd so linux-btrfs only got patch 2.
The full series is here:
https://lore.kernel.org/all/20261201062738.1047159-1-penghuang@xxxxxxxxxx/
I'll Cc the cover letter to linux-btrfs next time.
> But we need a better interface for that, something like a disown just
> before returning to userspace or the caller, and a "take ownership"
> called as early as possible from the completion callback. Let's build
> such a proper highlevel interface and make it all the right things
> instead of encoding implementation details all over the tree.
Good point. btrfs_uring_read_extent() and btrfs_uring_read_finished()
already call btrfs_lockdep_inode_release() / acquire() for this handoff,
so replacing both that and rwsem_boost_untrack() with a proper pair on
rw_semaphore makes much more sense.
One small thing: we'd want to disown before submitting the async read
(and re-own on error) since completion can unlock i_rwsem right away.
Do you or the locking folks have a preferred name, like
rwsem_disown_read() / rwsem_own_read()?
Thanks,
Peng