Commit ec23df2b authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Bob Peterson

gfs2: Fix marking bitmaps non-full

Reservations in gfs can span multiple gfs2_bitmaps (but they won't span
multiple resource groups).  When removing a reservation, we want to
clear the GBF_FULL flags of all involved gfs2_bitmaps, not just that of
the first bitmap.
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
Reviewed-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent 243fea4d
...@@ -641,7 +641,10 @@ static void __rs_deltree(struct gfs2_blkreserv *rs) ...@@ -641,7 +641,10 @@ static void __rs_deltree(struct gfs2_blkreserv *rs)
RB_CLEAR_NODE(&rs->rs_node); RB_CLEAR_NODE(&rs->rs_node);
if (rs->rs_free) { if (rs->rs_free) {
struct gfs2_bitmap *bi = rbm_bi(&rs->rs_rbm); u64 last_block = gfs2_rbm_to_block(&rs->rs_rbm) +
rs->rs_free - 1;
struct gfs2_rbm last_rbm = { .rgd = rs->rs_rbm.rgd, };
struct gfs2_bitmap *start, *last;
/* return reserved blocks to the rgrp */ /* return reserved blocks to the rgrp */
BUG_ON(rs->rs_rbm.rgd->rd_reserved < rs->rs_free); BUG_ON(rs->rs_rbm.rgd->rd_reserved < rs->rs_free);
...@@ -652,7 +655,13 @@ static void __rs_deltree(struct gfs2_blkreserv *rs) ...@@ -652,7 +655,13 @@ static void __rs_deltree(struct gfs2_blkreserv *rs)
it will force the number to be recalculated later. */ it will force the number to be recalculated later. */
rgd->rd_extfail_pt += rs->rs_free; rgd->rd_extfail_pt += rs->rs_free;
rs->rs_free = 0; rs->rs_free = 0;
clear_bit(GBF_FULL, &bi->bi_flags); if (gfs2_rbm_from_block(&last_rbm, last_block))
return;
start = rbm_bi(&rs->rs_rbm);
last = rbm_bi(&last_rbm);
do
clear_bit(GBF_FULL, &start->bi_flags);
while (start++ != last);
} }
} }
......
Markdown is supported
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