Merge branch 'upstream-jgarzik' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / fs / gfs2 / ops_inode.c
index 9cc07f4..911c115 100644 (file)
@@ -749,7 +749,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
                if (error)
                        goto out_end_trans;
 
-               error = gfs2_dir_mvino(ip, &name, nip, DT_DIR);
+               error = gfs2_dir_mvino(ip, &name, ndip, DT_DIR);
                if (error)
                        goto out_end_trans;
        } else {
@@ -903,8 +903,8 @@ static int setattr_size(struct inode *inode, struct iattr *attr)
        }
 
        error = gfs2_truncatei(ip, attr->ia_size);
-       if (error)
-               return error;
+       if (error && (inode->i_size != ip->i_di.di_size))
+               i_size_write(inode, ip->i_di.di_size);
 
        return error;
 }