Skip to contentSkip to conversation

GFS2: Stop block extents at the end of bitmaps

PATCH New Bob Peterson 2 participants 2 messages Aug 28, 2012 1 message not in the archive GFS2 file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 GFS2: Stop block extents at the end of bitmaps

Hi,

This patch stops multiple block allocations if a nonzero return code is received from gfs2_rbm_from_block. Without this patch, if enough pressure is put on the file system, you get a kernel warning quickly followed by:

BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [<ffffffffa04f47e8>] gfs2_alloc_blocks+0x2c8/0x880 [gfs2]

With this patch, things run normally.

Regards,

Bob Peterson
Red Hat File Systems

---

fs/gfs2/rgrp.c +1 -2
index 87ee0b7..081fba8 100644
@@ -1852,8 +1852,7 @@ static void gfs2_alloc_extent(const struct gfs2_rbm *rbm, bool dinode,
 	block++;
 	while (*n < elen) {
 		ret = gfs2_rbm_from_block(&pos, block);
-		WARN_ON(ret);
-		if (gfs2_testbit(&pos) != GFS2_BLKST_FREE)
+		if (ret || gfs2_testbit(&pos) != GFS2_BLKST_FREE)
 			break;
 		gfs2_trans_add_bh(pos.rgd->rd_gl, pos.bi->bi_bh, 1);
 		gfs2_setbit(&pos, true, GFS2_BLKST_USED);
#2 lore raw

PATCH 1/1 GFS2: Stop block extents at the end of bitmaps

Hi,

Quoted 6 lines · Bob Peterson

Hi,

This patch stops multiple block allocations if a nonzero return code is received from gfs2_rbm_from_block. Without this patch, if enough pressure is put on the file system, you get a kernel warning quickly followed by:

Quoted 6 lines
BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [<ffffffffa04f47e8>] gfs2_alloc_blocks+0x2c8/0x880 [gfs2]

With this patch, things run normally.

Regards,

Now in the -nmw tree. Thanks,

Steve.

Quoted 20 lines

Bob Peterson
Red Hat File Systems

---

fs/gfs2/rgrp.c +1 -2
index 87ee0b7..081fba8 100644
@@ -1852,8 +1852,7 @@ static void gfs2_alloc_extent(const struct gfs2_rbm *rbm, bool dinode,
 	block++;
 	while (*n < elen) {
 		ret = gfs2_rbm_from_block(&pos, block);
-		WARN_ON(ret);
-		if (gfs2_testbit(&pos) != GFS2_BLKST_FREE)
+		if (ret || gfs2_testbit(&pos) != GFS2_BLKST_FREE)
 			break;
 		gfs2_trans_add_bh(pos.rgd->rd_gl, pos.bi->bi_bh, 1);
 		gfs2_setbit(&pos, true, GFS2_BLKST_USED);