Skip to content

Commit

Permalink
GFS2: Fix case where reservation finished at end of rgrp
Browse files Browse the repository at this point in the history
One corner case which the original patch failed to take into
account was when there is a reservation which ended such that
the following block was one beyond the end of the rgrp in
question. This extra test fixes that case.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Reported-by: Bob Peterson <rpeterso@redhat.com>
Tested-by: Bob Peterson <rpeterso@redhat.com>
  • Loading branch information
Steven Whitehouse committed Sep 24, 2012
1 parent 24d634e commit 5d50d53
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fs/gfs2/rgrp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,12 @@ static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state,
n += (rbm->bi - initial_bi);
goto find_next;
}
if (ret == -E2BIG) {
index = 0;
rbm->offset = 0;
n += (rbm->bi - initial_bi);
goto res_covered_end_of_rgrp;
}
return ret;

bitmap_full: /* Mark bitmap as full and fall through */
Expand All @@ -1608,6 +1614,7 @@ static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state,
index++;
if (index == rbm->rgd->rd_length)
index = 0;
res_covered_end_of_rgrp:
rbm->bi = &rbm->rgd->rd_bits[index];
if ((index == 0) && nowrap)
break;
Expand Down

0 comments on commit 5d50d53

Please sign in to comment.