Skip to content

Commit 2d29f6b

Browse files
author
Andreas Gruenbacher
committed
gfs2: Fix loop in gfs2_rbm_find
Fix the resource group wrap-around logic in gfs2_rbm_find that commit e579ed4 broke. The bug can lead to unnecessary repeated scanning of the same bitmaps; there is a risk that future changes will turn this into an endless loop. Fixes: e579ed4 ("GFS2: Introduce rbm field bii") Cc: stable@vger.kernel.org # v3.13+ Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
1 parent 6ff9b09 commit 2d29f6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/gfs2/rgrp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1780,9 +1780,9 @@ static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state, u32 *minext,
17801780
goto next_iter;
17811781
}
17821782
if (ret == -E2BIG) {
1783+
n += rbm->bii - initial_bii;
17831784
rbm->bii = 0;
17841785
rbm->offset = 0;
1785-
n += (rbm->bii - initial_bii);
17861786
goto res_covered_end_of_rgrp;
17871787
}
17881788
return ret;

0 commit comments

Comments
 (0)