Skip to contentSkip to conversation

- kernel panic with small gfs2 filesystems - 1 RG

PATCH New Abhijith Das 2 participants 2 messages Jul 18, 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): f9e5e94f-eaa0-416c-92cd-52b66442a32d@zmail12.collab.prod.int.phx2.redhat.com

#1 lore raw

PATCH 1/1 - kernel panic with small gfs2 filesystems - 1 RG

In the unlikely setup where there's only one resource group in the gfs2 filesystem, gfs2_rgrpd_get_next() returns a NULL rgd that is not dealt with properly, causing a kernel NULL ptr dereference. This patch fixes this issue.

This bug was reported in rhel6: https://bugzilla.redhat.com/show_bug.cgi?id=838638

fs/gfs2/rgrp.c +1 -0
index e53d0a1..fb70792 100644
@@ -1276,6 +1276,7 @@ int gfs2_inplace_reserve(struct gfs2_inode *ip, u32 requested)
 			/* fall through */
 		case GLR_TRYFAILED:
 			rgd = gfs2_rgrpd_get_next(rgd);
+			rgd = rgd ? : begin; /* if NULL, wrap */
 			if (rgd != begin) /* If we didn't wrap */
 				break;
 
#2 lore raw

PATCH 1/1 - kernel panic with small gfs2 filesystems - 1 RG

Hi,

Now in the -nmw tree. Thanks,

Steve.

Quoted 20 lines · Abhijith Das

In the unlikely setup where there's only one resource group in the gfs2 filesystem, gfs2_rgrpd_get_next() returns a NULL rgd that is not dealt with properly, causing a kernel NULL ptr dereference. This patch fixes this issue.

This bug was reported in rhel6: https://bugzilla.redhat.com/show_bug.cgi?id=838638

fs/gfs2/rgrp.c +1 -0
index e53d0a1..fb70792 100644
@@ -1276,6 +1276,7 @@ int gfs2_inplace_reserve(struct gfs2_inode *ip, u32 requested)
 			/* fall through */
 		case GLR_TRYFAILED:
 			rgd = gfs2_rgrpd_get_next(rgd);
+			rgd = rgd ? : begin; /* if NULL, wrap */
 			if (rgd != begin) /* If we didn't wrap */
 				break;