Skip to content

Commit b854c7b

Browse files
Andreas Gruenbachergregkh
authored andcommitted
gfs2: Fix loop in gfs2_rbm_find
commit 2d29f6b96d8f80322ed2dd895bca590491c38d34 upstream. 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: [email protected] # v3.13+ Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Bob Peterson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 02b03b2 commit b854c7b

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
@@ -1705,9 +1705,9 @@ static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state, u32 *minext,
17051705
goto next_iter;
17061706
}
17071707
if (ret == -E2BIG) {
1708+
n += rbm->bii - initial_bii;
17081709
rbm->bii = 0;
17091710
rbm->offset = 0;
1710-
n += (rbm->bii - initial_bii);
17111711
goto res_covered_end_of_rgrp;
17121712
}
17131713
return ret;

0 commit comments

Comments
 (0)