Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d8072e7 authored by Peter Huewe's avatar Peter Huewe Committed by Linus Torvalds
Browse files

autofs - Fix sparse warning: context imbalance in autofs4_d_automount()...


autofs - Fix sparse warning: context imbalance in autofs4_d_automount() different lock contexts for basic block

Sparse complains:

  fs/autofs4/root.c:409:9: sparse: context imbalance in 'autofs4_d_automount' - different lock contexts for basic block

This was introduced by commit f55fb0c2 ("autofs4 - dont clear
DCACHE_NEED_AUTOMOUNT on rootless mount")

The function autofs4_d_automount can be left with the (&sbi->fs_lock)
held if sbi->version <= 4 and simple_empty(dentry) == false so the
warning seems valid.

--> Add an spin_unlock in this case before we jump to done

Unfortunately compile tested only.

Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: default avatarPeter Huewe <peterhuewe@gmx.de>
Acked-by: default avatarIan Kent <raven@themaw.net>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b0af9cd9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -383,9 +383,11 @@ static struct vfsmount *autofs4_d_automount(struct path *path)
				goto done;
			}
		} else {
			if (!simple_empty(dentry))
			if (!simple_empty(dentry)) {
				spin_unlock(&sbi->fs_lock);
				goto done;
			}
		}
		ino->flags |= AUTOFS_INF_PENDING;
		spin_unlock(&sbi->fs_lock);
		status = autofs4_mount_wait(dentry);