]> git.baikalelectronics.ru Git - kernel.git/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)
committerAndreas Gruenbacher <agruenba@redhat.com>
Tue, 17 Sep 2019 14:50:50 +0000 (16:50 +0200)
commitee5e5a3cd439d521369566174c0adc5270583124
treec8eb73a587eb99d5c7ba5646a087692ebd34b076
parentc389162710d31e842cfdfc9d72a1447131ae0fc6
gfs2: clear buf_in_tr when ending a transaction in sweep_bh_for_rgrps

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: 9192f48ea572 ("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>
fs/gfs2/bmap.c