Re: [PATCH] ocfs2: fix buffer head management in ocfs2_read_blocks()

Andrew Morton <[email protected]> Fri, 29 May 2026 19:01:01 -0700
Newsgroups dev.linux.lists.ocfs2-devel
Message-ID <[email protected]>
On Fri, 29 May 2026 12:41:28 +0300 Dmitry Antipov <[email protected]> wrote:

> Cc: Joel Becker <[email protected]>, Mark Fasheh <[email protected]>, Changwei Ge <[email protected]>, [email protected], [email protected], Dmitry Antipov <[email protected]>, [email protected]

fyi, ocfs2-devel is not among the mailing lists which are monitored
by Sashiko AI review.  To benefit from that review you may choose to cc
linux-kernel on patches.

> Subject: [PATCH] ocfs2: fix buffer head management in ocfs2_read_blocks()
> Date: Fri, 29 May 2026 12:41:28 +0300
> X-Mailer: git-send-email 2.54.0
> 
> In 'ocfs2_read_blocks()', caller should't assume that buffer head
> returned by 'sb_getblk()' is exclusively owned and so 'put_bh()'
> always drops b_count from 1 to 0. If it is not so, buffer head
> remains on hold and likely to be returned by the next call to
> 'sb_getblk()' unchanged - that is, with BH_Uptodate bit set even
> if it has failed validation previously, thus allowing to insert
> that buffer head into OCFS2 metadata cache and submit it to upper
> layers. To avoid such a scenario, BH_Uptodate should be cleared
> immediately after 'validate()' callback has detected some data
> inconsistency.

Added, thanks.