diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/rgrp.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 370c29b536ea..66b6d4d8b1d2 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c | |||
@@ -1496,11 +1496,19 @@ int gfs2_alloc_block(struct gfs2_inode *ip, u64 *bn, unsigned int *n) | |||
1496 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); | 1496 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
1497 | struct buffer_head *dibh; | 1497 | struct buffer_head *dibh; |
1498 | struct gfs2_alloc *al = ip->i_alloc; | 1498 | struct gfs2_alloc *al = ip->i_alloc; |
1499 | struct gfs2_rgrpd *rgd = al->al_rgd; | 1499 | struct gfs2_rgrpd *rgd; |
1500 | u32 goal, blk; | 1500 | u32 goal, blk; |
1501 | u64 block; | 1501 | u64 block; |
1502 | int error; | 1502 | int error; |
1503 | 1503 | ||
1504 | /* Only happens if there is a bug in gfs2, return something distinctive | ||
1505 | * to ensure that it is noticed. | ||
1506 | */ | ||
1507 | if (al == NULL) | ||
1508 | return -ECANCELED; | ||
1509 | |||
1510 | rgd = al->al_rgd; | ||
1511 | |||
1504 | if (rgrp_contains_block(rgd, ip->i_goal)) | 1512 | if (rgrp_contains_block(rgd, ip->i_goal)) |
1505 | goal = ip->i_goal - rgd->rd_data0; | 1513 | goal = ip->i_goal - rgd->rd_data0; |
1506 | else | 1514 | else |