diff options
-rw-r--r-- | fs/autofs4/root.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index cc87c1abac97..fb202cadd4b3 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c | |||
@@ -166,8 +166,10 @@ static struct dentry *autofs4_lookup_active(struct dentry *dentry) | |||
166 | const unsigned char *str = name->name; | 166 | const unsigned char *str = name->name; |
167 | struct list_head *p, *head; | 167 | struct list_head *p, *head; |
168 | 168 | ||
169 | spin_lock(&sbi->lookup_lock); | ||
170 | head = &sbi->active_list; | 169 | head = &sbi->active_list; |
170 | if (list_empty(head)) | ||
171 | return NULL; | ||
172 | spin_lock(&sbi->lookup_lock); | ||
171 | list_for_each(p, head) { | 173 | list_for_each(p, head) { |
172 | struct autofs_info *ino; | 174 | struct autofs_info *ino; |
173 | struct dentry *active; | 175 | struct dentry *active; |
@@ -218,8 +220,10 @@ static struct dentry *autofs4_lookup_expiring(struct dentry *dentry) | |||
218 | const unsigned char *str = name->name; | 220 | const unsigned char *str = name->name; |
219 | struct list_head *p, *head; | 221 | struct list_head *p, *head; |
220 | 222 | ||
221 | spin_lock(&sbi->lookup_lock); | ||
222 | head = &sbi->expiring_list; | 223 | head = &sbi->expiring_list; |
224 | if (list_empty(head)) | ||
225 | return NULL; | ||
226 | spin_lock(&sbi->lookup_lock); | ||
223 | list_for_each(p, head) { | 227 | list_for_each(p, head) { |
224 | struct autofs_info *ino; | 228 | struct autofs_info *ino; |
225 | struct dentry *expiring; | 229 | struct dentry *expiring; |