aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/autofs4/root.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index 2954ac5fec75..f6e8ca9ea56a 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -104,6 +104,14 @@ static void autofs4_del_active(struct dentry *dentry)
104 return; 104 return;
105} 105}
106 106
107static unsigned int autofs4_need_mount(unsigned int flags)
108{
109 unsigned int res = 0;
110 if (flags & (TRIGGER_FLAGS | TRIGGER_INTENTS))
111 res = 1;
112 return res;
113}
114
107static int autofs4_dir_open(struct inode *inode, struct file *file) 115static int autofs4_dir_open(struct inode *inode, struct file *file)
108{ 116{
109 struct dentry *dentry = file->f_path.dentry; 117 struct dentry *dentry = file->f_path.dentry;
@@ -168,7 +176,7 @@ static int try_to_fill_dentry(struct dentry *dentry, int flags)
168 } 176 }
169 /* Trigger mount for path component or follow link */ 177 /* Trigger mount for path component or follow link */
170 } else if (dentry->d_flags & DCACHE_AUTOFS_PENDING || 178 } else if (dentry->d_flags & DCACHE_AUTOFS_PENDING ||
171 flags & (TRIGGER_FLAGS | TRIGGER_INTENTS) || 179 autofs4_need_mount(flags) ||
172 current->link_count) { 180 current->link_count) {
173 DPRINTK("waiting for mount name=%.*s", 181 DPRINTK("waiting for mount name=%.*s",
174 dentry->d_name.len, dentry->d_name.name); 182 dentry->d_name.len, dentry->d_name.name);
@@ -234,7 +242,7 @@ static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd)
234 autofs4_expire_wait(dentry); 242 autofs4_expire_wait(dentry);
235 243
236 /* We trigger a mount for almost all flags */ 244 /* We trigger a mount for almost all flags */
237 lookup_type = nd->flags & (TRIGGER_FLAGS | TRIGGER_INTENTS); 245 lookup_type = autofs4_need_mount(nd->flags);
238 if (!(lookup_type || dentry->d_flags & DCACHE_AUTOFS_PENDING)) 246 if (!(lookup_type || dentry->d_flags & DCACHE_AUTOFS_PENDING))
239 goto follow; 247 goto follow;
240 248