linux/drivers/staging/zram
Jerome Marchand c5bde2388e Staging: zram: Replace mutex lock by a R/W semaphore
Currently, nothing protects zram table from concurrent access.
For instance, ZRAM_UNCOMPRESSED bit can be cleared by zram_free_page()
called from a concurrent write between the time ZRAM_UNCOMPRESSED has
been set and the time it is tested to unmap KM_USER0 in
zram_bvec_write(). This ultimately leads to kernel panic.

Also, a read request can occurs when the page has been freed by a
running write request and before it has been updated, leading to
zero filled block being incorrectly read and "Read before write"
error message.

This patch replace the current mutex by a rw_semaphore. It extends
the protection to zram table (currently, only compression buffers are
protected) and read requests (currently, only write requests are
protected).

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 10:07:13 -07:00
..
Kconfig staging: Allow sharing xvmalloc for zram and zcache 2011-02-23 14:02:56 -08:00
Makefile staging: Allow sharing xvmalloc for zram and zcache 2011-02-23 14:02:56 -08:00
xvmalloc_int.h zram/xvmalloc: Close 32byte hole on 64bit CPUs 2011-02-04 13:29:11 -08:00
xvmalloc.c staging: Allow sharing xvmalloc for zram and zcache 2011-02-23 14:02:56 -08:00
xvmalloc.h
zram_drv.c Staging: zram: Replace mutex lock by a R/W semaphore 2011-07-05 10:07:13 -07:00
zram_drv.h Staging: zram: Replace mutex lock by a R/W semaphore 2011-07-05 10:07:13 -07:00
zram_sysfs.c Staging: zram: round up the disk size provided by user 2011-01-20 16:06:18 -08:00
zram.txt Staging: zram: Update zram documentation 2010-08-31 15:36:36 -07:00