linux/drivers/staging/zcache
Andrea Righi cfbc6a9221 staging: zcache: avoid AB-BA deadlock condition
Commit 9256a47 fixed a deadlock condition, being sure that the buddy
list spinlock is always taken before the page spinlock.

However in zbud_free_and_delist() locking order is the opposite
(page lock -> list lock).

Possible unsafe locking scenario (reported by lockdep):

        CPU0                    CPU1
        ----                    ----
   lock(&(&zbpg->lock)->rlock);
                                lock(zbud_budlists_spinlock);
                                lock(&(&zbpg->lock)->rlock);
   lock(zbud_budlists_spinlock);

Fix by grabbing the locks in opposite order in zbud_free_and_delist().

Signed-off-by: Andrea Righi <andrea@betterlinux.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 11:59:59 -08:00
..
Kconfig staging: fix powerpc linux-next break on zsmalloc 2012-02-13 06:57:17 -08:00
Makefile staging: fix zcache building 2011-08-02 16:06:18 -07:00
tmem.c Staging: zcache: signedness bug in tmem_get() 2011-08-23 14:52:20 -07:00
tmem.h staging: zcache: support multiple clients, prep for KVM and RAMster 2011-07-08 14:18:53 -07:00
zcache-main.c staging: zcache: avoid AB-BA deadlock condition 2012-02-24 11:59:59 -08:00