summaryrefslogtreecommitdiffstats
path: root/fs/pipe.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2009-07-21 10:09:23 +0200
committerPeter Zijlstra <a.p.zijlstra@chello.nl>2009-07-22 21:14:14 +0200
commit023d43c7b5a23a81fe8afa9f37296f8ed4be11fb (patch)
treea817c4765d17c5d7facb66ae43cbc2b04c28c05b /fs/pipe.c
parentaea1f7964ae6cba5eb419a958956deb9016b3341 (diff)
downloadlinux-stable-023d43c7b5a23a81fe8afa9f37296f8ed4be11fb.tar.gz
linux-stable-023d43c7b5a23a81fe8afa9f37296f8ed4be11fb.tar.bz2
linux-stable-023d43c7b5a23a81fe8afa9f37296f8ed4be11fb.zip
lockdep: Fix lockdep annotation for pipe_double_lock()
The presumed use of the pipe_double_lock() routine is to lock 2 locks in a deadlock free way by ordering the locks by their address. However it fails to keep the specified lock classes in order and explicitly annotates a deadlock. Rectify this. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by: Miklos Szeredi <mszeredi@suse.cz> LKML-Reference: <1248163763.15751.11098.camel@twins>
Diffstat (limited to 'fs/pipe.c')
-rw-r--r--fs/pipe.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/pipe.c b/fs/pipe.c
index f7dd21ad85a6..52c415114838 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -68,8 +68,8 @@ void pipe_double_lock(struct pipe_inode_info *pipe1,
pipe_lock_nested(pipe1, I_MUTEX_PARENT);
pipe_lock_nested(pipe2, I_MUTEX_CHILD);
} else {
- pipe_lock_nested(pipe2, I_MUTEX_CHILD);
- pipe_lock_nested(pipe1, I_MUTEX_PARENT);
+ pipe_lock_nested(pipe2, I_MUTEX_PARENT);
+ pipe_lock_nested(pipe1, I_MUTEX_CHILD);
}
}