From: Jerome Marchand Date: Tue, 6 Sep 2011 13:02:11 +0000 (+0200) Subject: staging: zram: fix zram locking X-Git-Tag: v3.2-rc1~169^2^2~615 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0900beae178a84e653d9088979cf3014babc097e;p=pandora-kernel.git staging: zram: fix zram locking Currently init_lock only prevents concurrent execution of zram_init_device() and zram_reset_device() but not zram_make_request() nor sysfs store functions. This patch changes init_lock into a rw_semaphore. A write lock is taken by init, reset and store functions, a read lock is taken by zram_make_request(). Also, avoids to release the lock before calling __zram_reset_device() for cleaning after a failed init, thus preventing any concurrent task to see an inconsistent state of zram. Signed-off-by: Jerome Marchand Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed