]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
gfs2: bufdata allocation race
authorAndreas Gruenbacher <agruenba@redhat.com>
Fri, 13 Mar 2026 23:41:05 +0000 (00:41 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 30 Mar 2026 10:01:52 +0000 (12:01 +0200)
commit6e1a833df9524e05889cf0fe02879b02d85776fd
treeccc2ef85d8aa1bc9057a8fc9f55845bc2a68bc51
parent9e34adb1cc582bbcf1d74b23f1e6d9d71fb99fa1
gfs2: bufdata allocation race

The locking in gfs2_trans_add_data() and gfs2_trans_add_meta() doesn't
follow the usual coding pattern of checking bh->b_private under lock,
allocating a new bufdata object with the locks dropped, and re-checking
once the lock has been reacquired.  Both functions set bh->b_private
without holding the buffer lock.  Fix that.

Also, in gfs2_trans_add_meta(), taking the folio lock during the
allocation doesn't actually do anything useful.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/trans.c