From: Erez Zadok Date: Sun, 24 Nov 2013 19:28:38 +0000 (-0500) Subject: Unionfs: port to 3.8 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=ca75e7b2a0e5d0732548f4d2f3d816ee4d08cfee;p=unionfs-3.9.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 */