diff options
author | Abhijith Das <adas@redhat.com> | 2012-07-18 11:56:59 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2012-07-18 11:45:13 -0400 |
commit | 294f2ad5a545eb71d397623743ddd8201131bdad (patch) | |
tree | 7389ffbbef4562a2aa80b6e73a063229481fbc4c /fs | |
parent | 44b8db13860a449b5d85afdc65da654ce56da678 (diff) |
GFS2: 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.
Signed-off-by: Abhi Das <adas@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/rgrp.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index e53d0a1c234f..fb7079263ea7 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) | |||
1276 | /* fall through */ | 1276 | /* fall through */ |
1277 | case GLR_TRYFAILED: | 1277 | case GLR_TRYFAILED: |
1278 | rgd = gfs2_rgrpd_get_next(rgd); | 1278 | rgd = gfs2_rgrpd_get_next(rgd); |
1279 | rgd = rgd ? : begin; /* if NULL, wrap */ | ||
1279 | if (rgd != begin) /* If we didn't wrap */ | 1280 | if (rgd != begin) /* If we didn't wrap */ |
1280 | break; | 1281 | break; |
1281 | 1282 | ||