gfs2: Refcounting fix in gfs2_thaw_super
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 25 Dec 2023 19:07:46 +0000 (20:07 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 27 Dec 2023 12:16:48 +0000 (13:16 +0100)
commit4e58543e7da4859c4ba61d15493e3522b6ad71fd
treea3213c9193b3bbf4f1df7105f469282fe325baa4
parent5a7a964689b78be5817f14409619fded6882821d
gfs2: Refcounting fix in gfs2_thaw_super

It turns out that the .freeze_super and .thaw_super operations require
the filesystem to manage the superblock refcount itself.  We are using
the freeze_super() and thaw_super() helpers to mostly take care of that
for us, but this means that the superblock may no longer be around by
when thaw_super() returns, and gfs2_thaw_super() will then access freed
memory.  Take an extra superblock reference in gfs2_thaw_super() to fix
that.

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