From: Andrea Righi Date: Mon, 20 Feb 2012 12:11:49 +0000 (+0100) Subject: staging: zcache: avoid AB-BA deadlock condition X-Git-Tag: v3.4-rc1~186^2~127 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfbc6a92212e74b07aa76c9e2f20c542e36077fb;p=pandora-kernel.git 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 Cc: stable Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed