aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/super.c')
-rw-r--r--fs/gfs2/super.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 77cb9f830ee4..e031fa4965a3 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -342,15 +342,14 @@ int gfs2_jdesc_check(struct gfs2_jdesc *jd)
342{ 342{
343 struct gfs2_inode *ip = GFS2_I(jd->jd_inode); 343 struct gfs2_inode *ip = GFS2_I(jd->jd_inode);
344 struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode); 344 struct gfs2_sbd *sdp = GFS2_SB(jd->jd_inode);
345 u64 size = i_size_read(jd->jd_inode);
345 346
346 if (ip->i_disksize < (8 << 20) || ip->i_disksize > (1 << 30) || 347 if (gfs2_check_internal_file_size(jd->jd_inode, 8 << 20, 1 << 30))
347 (ip->i_disksize & (sdp->sd_sb.sb_bsize - 1))) {
348 gfs2_consist_inode(ip);
349 return -EIO; 348 return -EIO;
350 }
351 jd->jd_blocks = ip->i_disksize >> sdp->sd_sb.sb_bsize_shift;
352 349
353 if (gfs2_write_alloc_required(ip, 0, ip->i_disksize)) { 350 jd->jd_blocks = size >> sdp->sd_sb.sb_bsize_shift;
351
352 if (gfs2_write_alloc_required(ip, 0, size)) {
354 gfs2_consist_inode(ip); 353 gfs2_consist_inode(ip);
355 return -EIO; 354 return -EIO;
356 } 355 }