aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/ops_inode.c')
-rw-r--r--fs/gfs2/ops_inode.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index 1d3f2fb466bd..ee6ffd590418 100644
--- a/fs/gfs2/ops_inode.c
+++ b/fs/gfs2/ops_inode.c
@@ -406,7 +406,6 @@ static int gfs2_symlink(struct inode *dir, struct dentry *dentry,
406 406
407 ip = ghs[1].gh_gl->gl_object; 407 ip = ghs[1].gh_gl->gl_object;
408 408
409 ip->i_disksize = size;
410 i_size_write(inode, size); 409 i_size_write(inode, size);
411 410
412 error = gfs2_meta_inode_buffer(ip, &dibh); 411 error = gfs2_meta_inode_buffer(ip, &dibh);
@@ -461,7 +460,7 @@ static int gfs2_mkdir(struct inode *dir, struct dentry *dentry, int mode)
461 ip = ghs[1].gh_gl->gl_object; 460 ip = ghs[1].gh_gl->gl_object;
462 461
463 ip->i_inode.i_nlink = 2; 462 ip->i_inode.i_nlink = 2;
464 ip->i_disksize = sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode); 463 i_size_write(inode, sdp->sd_sb.sb_bsize - sizeof(struct gfs2_dinode));
465 ip->i_diskflags |= GFS2_DIF_JDATA; 464 ip->i_diskflags |= GFS2_DIF_JDATA;
466 ip->i_entries = 2; 465 ip->i_entries = 2;
467 466
@@ -990,7 +989,7 @@ static void *gfs2_follow_link(struct dentry *dentry, struct nameidata *nd)
990 struct gfs2_inode *ip = GFS2_I(dentry->d_inode); 989 struct gfs2_inode *ip = GFS2_I(dentry->d_inode);
991 struct gfs2_holder i_gh; 990 struct gfs2_holder i_gh;
992 struct buffer_head *dibh; 991 struct buffer_head *dibh;
993 unsigned int x; 992 unsigned int x, size;
994 char *buf; 993 char *buf;
995 int error; 994 int error;
996 995
@@ -1002,7 +1001,8 @@ static void *gfs2_follow_link(struct dentry *dentry, struct nameidata *nd)
1002 return NULL; 1001 return NULL;
1003 } 1002 }
1004 1003
1005 if (!ip->i_disksize) { 1004 size = (unsigned int)i_size_read(&ip->i_inode);
1005 if (size == 0) {
1006 gfs2_consist_inode(ip); 1006 gfs2_consist_inode(ip);
1007 buf = ERR_PTR(-EIO); 1007 buf = ERR_PTR(-EIO);
1008 goto out; 1008 goto out;
@@ -1014,7 +1014,7 @@ static void *gfs2_follow_link(struct dentry *dentry, struct nameidata *nd)
1014 goto out; 1014 goto out;
1015 } 1015 }
1016 1016
1017 x = ip->i_disksize + 1; 1017 x = size + 1;
1018 buf = kmalloc(x, GFP_NOFS); 1018 buf = kmalloc(x, GFP_NOFS);
1019 if (!buf) 1019 if (!buf)
1020 buf = ERR_PTR(-ENOMEM); 1020 buf = ERR_PTR(-ENOMEM);