Skip to content

Commit

Permalink
gfs2: clear buf_in_tr when ending a transaction in sweep_bh_for_rgrps
Browse files Browse the repository at this point in the history
commit f0b444b 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: d552a2b ("GFS2: Non-recursive delete")
Cc: [email protected] # v4.12+
Signed-off-by: Bob Peterson <[email protected]>
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
AstralBob authored and gregkh committed Oct 5, 2019
1 parent 3620b06 commit e0c1e6e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/gfs2/bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1630,6 +1630,7 @@ static int sweep_bh_for_rgrps(struct gfs2_inode *ip, struct gfs2_holder *rd_gh,
brelse(dibh);
up_write(&ip->i_rw_mutex);
gfs2_trans_end(sdp);
buf_in_tr = false;
}
gfs2_glock_dq_uninit(rd_gh);
cond_resched();
Expand Down

0 comments on commit e0c1e6e

Please sign in to comment.