linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mnt: release locks on error path in do_loopback
@ 2013-04-09 13:33 Andrey Vagin
  2013-04-09 18:24 ` Al Viro
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Vagin @ 2013-04-09 13:33 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-kernel, linux-fsdevel, Andrey Vagin

do_loopback calls lock_mount(path) and forget to unlock_mount
if clone_mnt or copy_mnt fails.

[   77.661566] ================================================
[   77.662939] [ BUG: lock held when returning to user space! ]
[   77.664104] 3.9.0-rc5+ #17 Not tainted
[   77.664982] ------------------------------------------------
[   77.666488] mount/514 is leaving the kernel with locks still held!
[   77.668027] 2 locks held by mount/514:
[   77.668817]  #0:  (&sb->s_type->i_mutex_key#7){+.+.+.}, at: [<ffffffff811cca22>] lock_mount+0x32/0xe0
[   77.671755]  #1:  (&namespace_sem){+++++.}, at: [<ffffffff811cca3a>] lock_mount+0x4a/0xe0

Signed-off-by: Andrey Vagin <avagin@openvz.org>
---
 fs/namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index f4fa671e..a81343e 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1704,7 +1704,7 @@ static int do_loopback(struct path *path, const char *old_name,
 
 	if (IS_ERR(mnt)) {
 		err = PTR_ERR(mnt);
-		goto out;
+		goto out2;
 	}
 
 	err = graft_tree(mnt, path);
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mnt: release locks on error path in do_loopback
  2013-04-09 13:33 [PATCH] mnt: release locks on error path in do_loopback Andrey Vagin
@ 2013-04-09 18:24 ` Al Viro
  0 siblings, 0 replies; 2+ messages in thread
From: Al Viro @ 2013-04-09 18:24 UTC (permalink / raw)
  To: Andrey Vagin; +Cc: linux-kernel, linux-fsdevel

On Tue, Apr 09, 2013 at 05:33:29PM +0400, Andrey Vagin wrote:
> do_loopback calls lock_mount(path) and forget to unlock_mount
> if clone_mnt or copy_mnt fails.

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-09 18:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-09 13:33 [PATCH] mnt: release locks on error path in do_loopback Andrey Vagin
2013-04-09 18:24 ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).