Skip to content

Commit

Permalink
gfs2: Lock imbalance on error path in gfs2_recover_one
Browse files Browse the repository at this point in the history
In gfs2_recover_one, fix a sd_log_flush_lock imbalance when a recovery
pass fails.

Fixes: c9ebc4b ("gfs2: allow journal replay to hold sd_log_flush_lock")
Cc: stable@vger.kernel.org # v5.7+
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
  • Loading branch information
Andreas Gruenbacher committed Feb 5, 2021
1 parent 8221894 commit 834ec3e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/gfs2/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,10 @@ void gfs2_recover_func(struct work_struct *work)
error = foreach_descriptor(jd, head.lh_tail,
head.lh_blkno, pass);
lops_after_scan(jd, error, pass);
if (error)
if (error) {
up_read(&sdp->sd_log_flush_lock);
goto fail_gunlock_thaw;
}
}

recover_local_statfs(jd, &head);
Expand Down

0 comments on commit 834ec3e

Please sign in to comment.