ovl: don't traverse automount points
authorMiklos Szeredi <mszeredi@suse.cz>
Mon, 22 Jun 2015 11:53:48 +0000 (13:53 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Mon, 22 Jun 2015 11:53:48 +0000 (13:53 +0200)
NFS and other distributed filesystems may place automount points in the
tree.  Previoulsy overlayfs refused to mount such filesystems types (based
on the existence of the .d_automount callback), even if the actual export
didn't have any automount points.

It cannot be determined in advance whether the filesystem has automount
points or not.  The solution is to allow fs with .d_automount but refuse to
traverse any automount points encountered.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
fs/overlayfs/super.c

index bf8537c7f455207830046a50d67d394f86d37f4a..de9d2ee68ccfbc876fa584f3d607318aebd75937 100644 (file)
@@ -303,6 +303,10 @@ static inline struct dentry *ovl_lookup_real(struct dentry *dir,
        } else if (!dentry->d_inode) {
                dput(dentry);
                dentry = NULL;
+       } else if (dentry->d_flags & DCACHE_MANAGED_DENTRY) {
+               dput(dentry);
+               /* Don't support traversing automounts */
+               dentry = ERR_PTR(-EREMOTE);
        }
        return dentry;
 }
@@ -700,12 +704,12 @@ static bool ovl_is_allowed_fs_type(struct dentry *root)
 
        /*
         * We don't support:
-        *  - automount filesystems
+        *  - autofs
         *  - filesystems with revalidate (FIXME for lower layer)
         *  - filesystems with case insensitive names
         */
        if (dop &&
-           (dop->d_manage || dop->d_automount ||
+           (dop->d_manage ||
             dop->d_revalidate || dop->d_weak_revalidate ||
             dop->d_compare || dop->d_hash)) {
                return false;
This page took 0.027871 seconds and 5 git commands to generate.