Commit 5d50d532 authored by Steven Whitehouse's avatar Steven Whitehouse
Browse files

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: default avatarSteven Whitehouse <>
Reported-by: default avatarBob Peterson <>
Tested-by: default avatarBob Peterson <>
parent 24d634e8
......@@ -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 */
......@@ -1608,6 +1614,7 @@ static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state,
if (index == rbm->rgd->rd_length)
index = 0;
rbm->bi = &rbm->rgd->rd_bits[index];
if ((index == 0) && nowrap)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment