net: phy: provide stub for fixed_phy_set_link_update
[firefly-linux-kernel-4.4.55.git] / fs / autofs4 / root.c
index cc87c1abac9710169cd56ad44a78cf7185da2834..cdb25ebccc4c49c2ac2f4a4c17d998ae99f14941 100644 (file)
@@ -166,8 +166,10 @@ static struct dentry *autofs4_lookup_active(struct dentry *dentry)
        const unsigned char *str = name->name;
        struct list_head *p, *head;
 
-       spin_lock(&sbi->lookup_lock);
        head = &sbi->active_list;
+       if (list_empty(head))
+               return NULL;
+       spin_lock(&sbi->lookup_lock);
        list_for_each(p, head) {
                struct autofs_info *ino;
                struct dentry *active;
@@ -218,8 +220,10 @@ static struct dentry *autofs4_lookup_expiring(struct dentry *dentry)
        const unsigned char *str = name->name;
        struct list_head *p, *head;
 
-       spin_lock(&sbi->lookup_lock);
        head = &sbi->expiring_list;
+       if (list_empty(head))
+               return NULL;
+       spin_lock(&sbi->lookup_lock);
        list_for_each(p, head) {
                struct autofs_info *ino;
                struct dentry *expiring;
@@ -373,7 +377,7 @@ static struct vfsmount *autofs4_d_automount(struct path *path)
                 * this because the leaves of the directory tree under the
                 * mount never trigger mounts themselves (they have an autofs
                 * trigger mount mounted on them). But v4 pseudo direct mounts
-                * do need the leaves to to trigger mounts. In this case we
+                * do need the leaves to trigger mounts. In this case we
                 * have no choice but to use the list_empty() check and
                 * require user space behave.
                 */