]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/namei.c
Add an AT_NO_AUTOMOUNT flag to suppress terminal automount
[mv-sheeva.git] / fs / namei.c
index 9d3033dc22e9cd7637364a545c29b104c93f9fdd..dc50bfb2f5d6fac3b613cc41c6d8833694fa2196 100644 (file)
@@ -908,6 +908,12 @@ static int follow_automount(struct path *path, unsigned flags,
        if (!path->dentry->d_op || !path->dentry->d_op->d_automount)
                return -EREMOTE;
 
+       /* We don't want to mount if someone supplied AT_NO_AUTOMOUNT
+        * and this is the terminal part of the path.
+        */
+       if ((flags & LOOKUP_NO_AUTOMOUNT) && !(flags & LOOKUP_CONTINUE))
+               return -EISDIR; /* we actually want to stop here */
+
        /* We want to mount if someone is trying to open/create a file of any
         * type under the mountpoint, wants to traverse through the mountpoint
         * or wants to open the mounted directory.