提交 a3cfbb53 编写于 作者: L Li Zefan 提交者: Linus Torvalds

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: NLi Zefan <lizf@cn.fujitsu.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Menage <menage@google.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 e5bc49ba
...@@ -371,8 +371,10 @@ struct super_block *sget(struct file_system_type *type, ...@@ -371,8 +371,10 @@ struct super_block *sget(struct file_system_type *type,
continue; continue;
if (!grab_super(old)) if (!grab_super(old))
goto retry; goto retry;
if (s) if (s) {
up_write(&s->s_umount);
destroy_super(s); destroy_super(s);
}
return old; return old;
} }
} }
...@@ -387,6 +389,7 @@ struct super_block *sget(struct file_system_type *type, ...@@ -387,6 +389,7 @@ struct super_block *sget(struct file_system_type *type,
err = set(s, data); err = set(s, data);
if (err) { if (err) {
spin_unlock(&sb_lock); spin_unlock(&sb_lock);
up_write(&s->s_umount);
destroy_super(s); destroy_super(s);
return ERR_PTR(err); return ERR_PTR(err);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册