Skip to content

Commit

Permalink
GFS2: kernel panic with small gfs2 filesystems - 1 RG
Browse files Browse the repository at this point in the history
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 <adas@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
Abhijith Das authored and Steven Whitehouse committed Jul 18, 2012
1 parent 44b8db1 commit 294f2ad
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/gfs2/rgrp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 294f2ad

Please sign in to comment.