diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2012-08-07 08:47:12 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2012-09-24 05:47:03 -0400 |
commit | 5d50d5324612d28c47b9361e5424f13a19c888cd (patch) | |
tree | d4cfa082e5d63e3e6017b7a41a9d7b005e9d875a /fs/gfs2 | |
parent | 24d634e8f3b43fe2eb7c7d66567de7aba8edc308 (diff) |
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')
-rw-r--r-- | fs/gfs2/rgrp.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 7ce22d8c489b..c17029a92b8f 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c | |||
@@ -1596,6 +1596,12 @@ find_next: | |||
1596 | n += (rbm->bi - initial_bi); | 1596 | n += (rbm->bi - initial_bi); |
1597 | goto find_next; | 1597 | goto find_next; |
1598 | } | 1598 | } |
1599 | if (ret == -E2BIG) { | ||
1600 | index = 0; | ||
1601 | rbm->offset = 0; | ||
1602 | n += (rbm->bi - initial_bi); | ||
1603 | goto res_covered_end_of_rgrp; | ||
1604 | } | ||
1599 | return ret; | 1605 | return ret; |
1600 | 1606 | ||
1601 | bitmap_full: /* Mark bitmap as full and fall through */ | 1607 | bitmap_full: /* Mark bitmap as full and fall through */ |
@@ -1608,6 +1614,7 @@ next_bitmap: /* Find next bitmap in the rgrp */ | |||
1608 | index++; | 1614 | index++; |
1609 | if (index == rbm->rgd->rd_length) | 1615 | if (index == rbm->rgd->rd_length) |
1610 | index = 0; | 1616 | index = 0; |
1617 | res_covered_end_of_rgrp: | ||
1611 | rbm->bi = &rbm->rgd->rd_bits[index]; | 1618 | rbm->bi = &rbm->rgd->rd_bits[index]; |
1612 | if ((index == 0) && nowrap) | 1619 | if ((index == 0) && nowrap) |
1613 | break; | 1620 | break; |