]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: Recursive gfs2_quota_hold in gfs2_iomap_end
authorAndreas Gruenbacher <agruenba@redhat.com>
Tue, 9 Feb 2021 17:32:32 +0000 (18:32 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 10 Feb 2021 08:51:06 +0000 (09:51 +0100)
commitb2d4162001f67080121d214d4cf069bb8aeaa279
tree1365088f922801b04d00c9948ec15f55ee59ba0f
parentffb3b1ea48752c5cef97eb62dad6a5be0feb7f01
gfs2: Recursive gfs2_quota_hold in gfs2_iomap_end

When starting an iomap write, gfs2_quota_lock_check -> gfs2_quota_lock
-> gfs2_quota_hold is called from gfs2_iomap_begin.  At the end of the
write, before unlocking the quotas, punch_hole -> gfs2_quota_hold can be
called again in gfs2_iomap_end, which is incorrect and leads to a failed
assertion.  Instead, move the call to gfs2_quota_unlock before the call
to punch_hole to fix that.

Fixes: ff673b97c3a1 ("gfs2: iomap buffered write support")
Cc: stable@vger.kernel.org # v4.19+
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/bmap.c