Merge branch 'overlayfs-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszer...
[sfrench/cifs-2.6.git] / fs / overlayfs / copy_up.c
index 48eb8812ac5b2220e9b2420cfc8ba659a9cf3bfd..906ea6c93260179c9c4947abe97c35750162c3e3 100644 (file)
@@ -15,7 +15,8 @@
 #include <linux/xattr.h>
 #include <linux/security.h>
 #include <linux/uaccess.h>
-#include <linux/sched.h>
+#include <linux/sched/signal.h>
+#include <linux/cred.h>
 #include <linux/namei.h>
 #include <linux/fdtable.h>
 #include <linux/ratelimit.h>
@@ -371,7 +372,8 @@ static int ovl_copy_up_one(struct dentry *parent, struct dentry *dentry,
        ovl_path_upper(parent, &parentpath);
        upperdir = parentpath.dentry;
 
-       err = vfs_getattr(&parentpath, &pstat);
+       err = vfs_getattr(&parentpath, &pstat,
+                         STATX_ATIME | STATX_MTIME, AT_STATX_SYNC_AS_STAT);
        if (err)
                return err;
 
@@ -450,7 +452,8 @@ int ovl_copy_up_flags(struct dentry *dentry, int flags)
                }
 
                ovl_path_lower(next, &lowerpath);
-               err = vfs_getattr(&lowerpath, &stat);
+               err = vfs_getattr(&lowerpath, &stat,
+                                 STATX_BASIC_STATS, AT_STATX_SYNC_AS_STAT);
                /* maybe truncate regular file. this has no effect on dirs */
                if (flags & O_TRUNC)
                        stat.size = 0;