From: Erez Zadok Date: Wed, 27 Nov 2013 03:01:34 +0000 (-0500) Subject: Unionfs: port to 3.8 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=8e242e32c6d9fc9b8abe5872fc2d5f7f619279b4;p=unionfs-3.13.y.git Unionfs: port to 3.8 Signed-off-by: Erez Zadok --- diff --git a/fs/unionfs/inode.c b/fs/unionfs/inode.c index f25703ccd40..42a24fb8880 100644 --- a/fs/unionfs/inode.c +++ b/fs/unionfs/inode.c @@ -979,13 +979,10 @@ static int unionfs_setattr(struct dentry *dentry, struct iattr *ia) * the lower level. */ if (ia->ia_valid & ATTR_SIZE) { - size = i_size_read(inode); - if (ia->ia_size < size || (ia->ia_size > size && - inode->i_sb->s_maxbytes < lower_inode->i_sb->s_maxbytes)) { - err = vmtruncate(inode, ia->ia_size); - if (err) - goto out; - } + err = inode_newsize_ok(inode, ia->ia_size); + if (err) + goto out; + truncate_setsize(inode, ia->ia_size); } /* notify the (possibly copied-up) lower inode */