]> git.karo-electronics.de Git - karo-tx-linux.git/commit
reiserfs: fix inode mutex - reiserfs lock misordering
authorFrederic Weisbecker <fweisbec@gmail.com>
Wed, 24 Nov 2010 20:57:15 +0000 (12:57 -0800)
committerAndi Kleen <ak@linux.intel.com>
Tue, 14 Dec 2010 22:40:04 +0000 (23:40 +0100)
commit0dbd161b08707ffddfdc2cd64ab762fef72311c9
tree85fb7b9de822c0272cb378ba4e25c36eba68ffd0
parent1219932ca26da2026e598590a3b7a2f36b3c3621
reiserfs: fix inode mutex - reiserfs lock misordering

commit da905873effecd1c0166e578bc4b5006f041b18b upstream.

reiserfs_unpack() locks the inode mutex with reiserfs_mutex_lock_safe()
to protect against reiserfs lock dependency.  However this protection
requires to have the reiserfs lock to be locked.

This is the case if reiserfs_unpack() is called by reiserfs_ioctl but
not from reiserfs_quota_on() when it tries to unpack tails of quota
files.

Fix the ordering of the two locks in reiserfs_unpack() to fix this
issue.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Reported-by: Markus Gapp <markus.gapp@gmx.net>
Reported-by: Jan Kara <jack@suse.cz>
Cc: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
fs/reiserfs/ioctl.c