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=59eada35a2beafd7d275fccd65722bfa0fcb005a;p=unionfs-3.17.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 f25703ccd400..42a24fb88809 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 */