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
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
zram.txt