Re: [PATCH v2 33/34] buffer: Change calling convention for end_buffer_read_sync()

Matthew Wilcox <[email protected]> Sat, 30 May 2026 17:15:18 +0100
Newsgroups dev.linux.lists.gfs2,org.kernel.vger.linux-fsdevel
Message-ID <[email protected]>
On Sat, May 30, 2026 at 02:07:40PM +0200, Jan Kara wrote:
> On Thu 28-05-26 18:31:46, Matthew Wilcox (Oracle) wrote:
> > Unify end_buffer_read_sync() and __end_buffer_read_notouch()
> > by requiring the caller put the refcount on the buffer.  The only caller
> > is in the gfs2_meta_read() path, and there we can put the refcount
> > after locking the buffer.
> > 
> > Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
> 
> It seems a bit sad to keep end_buffer_read_sync() alive only for gfs2
> metadata reading path but let's leave that for another time. Feel free to
> add:
> 
> Reviewed-by: Jan Kara <[email protected]>

Thanks!  I agree that we've got two entry points (end_buffer_read_sync()
and bh_end_async_write()) each with one caller, and I'd be happier if
we could make both of them go away.

I keep reminding myself that we'd be better off converting gfs2 to iomap
than improving buffer.c to fit gfs2's needs.

As far as I can tell (... and I am so not an expert in gfs2), the main
thing we'd need to add to iomap to handle gfs2_meta_aops is the ability to
set REQ_META | REQ_PRIO.  Maybe that's an AS_METADATA flag on the mapping?

But maybe there's code elsewhere in gfs2 that depends on there being
buffer heads for the metadata address_space folios?