dect
/
linux-2.6
Archived
13
0
Fork 0

GFS2: Fix case where reservation finished at end of rgrp

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>
This commit is contained in:
Steven Whitehouse 2012-08-07 13:47:12 +01:00
parent 24d634e8f3
commit 5d50d53246
1 changed files with 7 additions and 0 deletions

View File

@ -1596,6 +1596,12 @@ find_next:
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 */
@ -1608,6 +1614,7 @@ next_bitmap: /* Find next bitmap in the rgrp */
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;