diff options
author | Peter Huewe <peterhuewe@gmx.de> | 2013-03-01 06:46:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-01 15:04:39 -0500 |
commit | 9d8072e7c33991a08b29338f3f04dfef7c24afd5 (patch) | |
tree | 3fda1dd5842eafb90405d3566407b0c55816ddec /fs/autofs4 | |
parent | b0af9cd9aab60ceb17d3ebabb9fdf4ff0a99cf50 (diff) |
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 f55fb0c24386 ("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: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Acked-by: Ian Kent <raven@themaw.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/autofs4')
-rw-r--r-- | fs/autofs4/root.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index 230bd2aad4f4..9bd16255dd9c 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c | |||
@@ -383,8 +383,10 @@ static struct vfsmount *autofs4_d_automount(struct path *path) | |||
383 | goto done; | 383 | goto done; |
384 | } | 384 | } |
385 | } else { | 385 | } else { |
386 | if (!simple_empty(dentry)) | 386 | if (!simple_empty(dentry)) { |
387 | spin_unlock(&sbi->fs_lock); | ||
387 | goto done; | 388 | goto done; |
389 | } | ||
388 | } | 390 | } |
389 | ino->flags |= AUTOFS_INF_PENDING; | 391 | ino->flags |= AUTOFS_INF_PENDING; |
390 | spin_unlock(&sbi->fs_lock); | 392 | spin_unlock(&sbi->fs_lock); |