Unionfs: port to 3.8
authorErez Zadok <ezk@cs.sunysb.edu>
Mon, 25 Nov 2013 02:10:46 +0000 (21:10 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 11 Nov 2014 00:47:48 +0000 (19:47 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/inode.c

index f25703ccd4001116b0eda93d6679897611a7cdf1..42a24fb88809ea8136db9847bac5c170e046a961 100644 (file)
@@ -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 */