]> git.itanic.dy.fi Git - linux-stable/commit
gfs2: clear buf_in_tr when ending a transaction in sweep_bh_for_rgrps
authorBob Peterson <rpeterso@redhat.com>
Thu, 12 Sep 2019 17:54:27 +0000 (13:54 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Oct 2019 10:48:08 +0000 (12:48 +0200)
commitfc936fae1b4582e390da674c3cf3bce8d67e8fa5
tree90a4f88234905c90096b75a597790ccac780bcc3
parentd7ce17fba6c8e316ca9a554a87edddce6f862435
gfs2: clear buf_in_tr when ending a transaction in sweep_bh_for_rgrps

commit f0b444b349e33ae0d3dd93e25ca365482a5d17d4 upstream.

In function sweep_bh_for_rgrps, which is a helper for punch_hole,
it uses variable buf_in_tr to keep track of when it needs to commit
pending block frees on a partial delete that overflows the
transaction created for the delete. The problem is that the
variable was initialized at the start of function sweep_bh_for_rgrps
but it was never cleared, even when starting a new transaction.

This patch reinitializes the variable when the transaction is
ended, so the next transaction starts out with it cleared.

Fixes: d552a2b9b33e ("GFS2: Non-recursive delete")
Cc: stable@vger.kernel.org # v4.12+
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/gfs2/bmap.c