Skip to content

Commit c9e58fb

Browse files
committed
gfs2: write revokes should traverse sd_ail1_list in reverse
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 <rpeterso@redhat.com>
1 parent 0ddeded commit c9e58fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/gfs2/log.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ void gfs2_write_revokes(struct gfs2_sbd *sdp)
621621

622622
gfs2_ail1_empty(sdp);
623623
spin_lock(&sdp->sd_ail_lock);
624-
list_for_each_entry(tr, &sdp->sd_ail1_list, tr_list) {
624+
list_for_each_entry_reverse(tr, &sdp->sd_ail1_list, tr_list) {
625625
list_for_each_entry(bd, &tr->tr_ail2_list, bd_ail_st_list) {
626626
if (list_empty(&bd->bd_list)) {
627627
have_revokes = 1;
@@ -645,7 +645,7 @@ void gfs2_write_revokes(struct gfs2_sbd *sdp)
645645
}
646646
gfs2_log_lock(sdp);
647647
spin_lock(&sdp->sd_ail_lock);
648-
list_for_each_entry(tr, &sdp->sd_ail1_list, tr_list) {
648+
list_for_each_entry_reverse(tr, &sdp->sd_ail1_list, tr_list) {
649649
list_for_each_entry_safe(bd, tmp, &tr->tr_ail2_list, bd_ail_st_list) {
650650
if (max_revokes == 0)
651651
goto out_of_blocks;

0 commit comments

Comments
 (0)