Skip to content

Commit

Permalink
vfs: add missing unlock in sget()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Zefan authored and torvalds committed Mar 12, 2009
1 parent e5bc49b commit a3cfbb5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,10 @@ struct super_block *sget(struct file_system_type *type,
continue;
if (!grab_super(old))
goto retry;
if (s)
if (s) {
up_write(&s->s_umount);
destroy_super(s);
}
return old;
}
}
Expand All @@ -387,6 +389,7 @@ struct super_block *sget(struct file_system_type *type,
err = set(s, data);
if (err) {
spin_unlock(&sb_lock);
up_write(&s->s_umount);
destroy_super(s);
return ERR_PTR(err);
}
Expand Down

0 comments on commit a3cfbb5

Please sign in to comment.