Hi,

Before this patch, function gfs2_rgrp_brelse would release its
buffer_heads for the rgrp bitmaps, but it did not release its
reservations. The problem is: When we need to call brelse, we're
basically letting go of the bitmaps, which means our reservations
are no longer valid: someone on another node may have reserved those
blocks and even used them. This patch makes the function returns all
the block reservations held for the rgrp whose buffer_heads are
being released.

Signed-off-by: Bob Peterson <[email protected]>
---
 fs/gfs2/rgrp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 7e22918d32d6..9348a18d56b9 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -1263,6 +1263,7 @@ void gfs2_rgrp_brelse(struct gfs2_rgrpd *rgd)
 {
        int x, length = rgd->rd_length;
 
+       return_all_reservations(rgd);
        for (x = 0; x < length; x++) {
                struct gfs2_bitmap *bi = rgd->rd_bits + x;
                if (bi->bi_bh) {

Reply via email to