summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-03-12 22:31:29 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-13 00:20:23 +0100
commita3cfbb53b1764a3d1f58ddc032737ab9edaa7d41 (patch)
tree818ca39043749382a4b91d0310f532bf2fdc22ce
parentpipe_rdwr_fasync: fix the error handling to prevent the leak/crash (diff)
downloadlinux-a3cfbb53b1764a3d1f58ddc032737ab9edaa7d41.tar.xz
linux-a3cfbb53b1764a3d1f58ddc032737ab9edaa7d41.zip
vfs: add missing unlock in sget()
In sget(), destroy_super(s) is called with s->s_umount held, which makes lockdep unhappy. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Cc: Al Viro <viro@ZenIV.linux.org.uk> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Menage <menage@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/super.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/super.c b/fs/super.c
index 8349ed6b1412..6ce501447ada 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -371,8 +371,10 @@ retry:
continue;
if (!grab_super(old))
goto retry;
- if (s)
+ if (s) {
+ up_write(&s->s_umount);
destroy_super(s);
+ }
return old;
}
}
@@ -387,6 +389,7 @@ retry:
err = set(s, data);
if (err) {
spin_unlock(&sb_lock);
+ up_write(&s->s_umount);
destroy_super(s);
return ERR_PTR(err);
}