From 4495fef09aeedefb70ba19552aaf3654cc898ac9 Mon Sep 17 00:00:00 2001 From: Erez Zadok Date: Tue, 26 Nov 2013 22:01:34 -0500 Subject: [PATCH] Unionfs: port to 3.8 Signed-off-by: Erez Zadok --- fs/unionfs/inode.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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 */ -- 2.34.1