kill-the-bkl/reiserfs: fix recursive reiserfs lock in reiserfs_mkdir()
authorFrederic Weisbecker <fweisbec@gmail.com>
Tue, 25 Aug 2009 00:44:21 +0000 (02:44 +0200)
committerFrederic Weisbecker <fweisbec@gmail.com>
Mon, 14 Sep 2009 05:18:27 +0000 (07:18 +0200)
commitb10ab4c337a600456ed2d9daea0331016f7cdeeb
tree6e85b1faea80835b5dcab78bf66d51b529711ada
parentae635c0bbd6c10aa62bf5149c6f41add59fbf4d2
kill-the-bkl/reiserfs: fix recursive reiserfs lock in reiserfs_mkdir()

reiserfs_mkdir() acquires the reiserfs lock, assuming it has been called
from the dir inodes callbacks, without the lock held.

But it can also be called from other internal sites such as
reiserfs_xattr_init() which already holds the lock. This recursive
locking leads to further wrong assumptions. For example, later calls
to reiserfs_mutex_lock_safe() won't actually unlock the reiserfs lock
the time we acquire a given mutex, creating unexpected lock inversions.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jeff Mahoney <jeffm@suse.com>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Alexander Beregalov <a.beregalov@gmail.com>
Cc: Laurent Riffard <laurent.riffard@free.fr>
fs/reiserfs/namei.c