zcache: fix deadlock condition
authorDan Magenheimer <dan.magenheimer@oracle.com>
Wed, 25 Jan 2012 22:32:51 +0000 (14:32 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Feb 2012 19:17:04 +0000 (11:17 -0800)
commit5c97f5b2d4924961479e862e8fe516ba217551b3
tree142849d515d6cdbf27898d457657f463359c6079
parentc1efec8273372700693661f094324081d8f3ad3d
zcache: fix deadlock condition

commit 9256a4789be3dae37d00924c03546ba7958ea5a3 upstream.

I discovered this deadlock condition awhile ago working on RAMster
but it affects zcache as well.  The list spinlock must be
locked prior to the page spinlock and released after.  As
a result, the page copy must also be done while the locks are held.

Applies to 3.2.  Konrad, please push (via GregKH?)...
this is definitely a bug fix so need not be pushed during
a -rc0 window.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/zcache/zcache-main.c