summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/rgrp.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2012-08-07 13:47:12 +0100
committerSteven Whitehouse <swhiteho@redhat.com>2012-09-24 10:47:03 +0100
commit5d50d5324612d28c47b9361e5424f13a19c888cd (patch)
treed4cfa082e5d63e3e6017b7a41a9d7b005e9d875a /fs/gfs2/rgrp.c
parent24d634e8f3b43fe2eb7c7d66567de7aba8edc308 (diff)
downloadop-kernel-dev-5d50d5324612d28c47b9361e5424f13a19c888cd.zip
op-kernel-dev-5d50d5324612d28c47b9361e5424f13a19c888cd.tar.gz
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>
Diffstat (limited to 'fs/gfs2/rgrp.c')
-rw-r--r--fs/gfs2/rgrp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 7ce22d8..c17029a 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -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;
OpenPOWER on IntegriCloud