Skip to content

Commit

Permalink
gfs2: write revokes should traverse sd_ail1_list in reverse
Browse files Browse the repository at this point in the history
All the other functions that deal with the sd_ail_list run the list
from the tail back to the head, iow, in reverse. We should do the
same while writing revokes, otherwise we might miss removing entries
properly from the list when we hit the limit of how many revokes we
can write at one time (based on block size, which determines how
many block pointers will fit in the revoke block).

Signed-off-by: Bob Peterson <[email protected]>
  • Loading branch information
AstralBob committed Oct 15, 2018
1 parent 0ddeded commit c9e58fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/gfs2/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ void gfs2_write_revokes(struct gfs2_sbd *sdp)

gfs2_ail1_empty(sdp);
spin_lock(&sdp->sd_ail_lock);
list_for_each_entry(tr, &sdp->sd_ail1_list, tr_list) {
list_for_each_entry_reverse(tr, &sdp->sd_ail1_list, tr_list) {
list_for_each_entry(bd, &tr->tr_ail2_list, bd_ail_st_list) {
if (list_empty(&bd->bd_list)) {
have_revokes = 1;
Expand All @@ -645,7 +645,7 @@ void gfs2_write_revokes(struct gfs2_sbd *sdp)
}
gfs2_log_lock(sdp);
spin_lock(&sdp->sd_ail_lock);
list_for_each_entry(tr, &sdp->sd_ail1_list, tr_list) {
list_for_each_entry_reverse(tr, &sdp->sd_ail1_list, tr_list) {
list_for_each_entry_safe(bd, tmp, &tr->tr_ail2_list, bd_ail_st_list) {
if (max_revokes == 0)
goto out_of_blocks;
Expand Down

0 comments on commit c9e58fb

Please sign in to comment.