Skip to content

Commit e9c5d8a

Browse files
avaginAl Viro
authored and
Al Viro
committed
mnt: release locks on error path in do_loopback
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 <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent ccf9320 commit e9c5d8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/namespace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1686,7 +1686,7 @@ static int do_loopback(struct path *path, const char *old_name,
16861686

16871687
if (IS_ERR(mnt)) {
16881688
err = PTR_ERR(mnt);
1689-
goto out;
1689+
goto out2;
16901690
}
16911691

16921692
err = graft_tree(mnt, path);

0 commit comments

Comments
 (0)