From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Whitehouse Date: Mon, 23 Jul 2012 09:01:04 +0100 Subject: [Cluster-devel] [PATCH 14/16] GFS2: kernel panic with small gfs2 filesystems - 1 RG In-Reply-To: <1343030466-3053-1-git-send-email-swhiteho@redhat.com> References: <1343030466-3053-1-git-send-email-swhiteho@redhat.com> Message-ID: <1343030466-3053-15-git-send-email-swhiteho@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit From: 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. Signed-off-by: Abhi Das Signed-off-by: Steven Whitehouse diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index e53d0a1..fb70792 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -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; -- 1.7.4