summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2013-10-20 13:37:39 +0100
committerBen Hutchings <ben@decadent.org.uk>2013-10-26 21:06:11 +0100
commit98ed9120b030962558276d8fd602eabb41a57d05 (patch)
tree1de8133406406861c8198a3060a37d4f98e79673 /drivers
parent8f0ce108f5e1c6a443548746b6f01b450f71a407 (diff)
Revert "zram: use zram->lock to protect zram_free_page() in swap free notify path"
This reverts commit 9e443904906ca2b5b3ae71f34ac4a4fa6905623e, which was commit 57ab048532c0d975538cebd4456491b5c34248f4 upstream. Taking the semaphore here leads to sleeping in atomic context. This was fixed in mainline commit a0c516cbfc74 ("zram: don't grab mutex in zram_slot_free_noity") but that is too difficult to backport. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/zram/zram_drv.c2
-rw-r--r--drivers/staging/zram/zram_drv.h5
2 files changed, 2 insertions, 5 deletions
diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
index 926d483139b8..d197b3ecfbb4 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -709,9 +709,7 @@ static void zram_slot_free_notify(struct block_device *bdev,
struct zram *zram;
zram = bdev->bd_disk->private_data;
- down_write(&zram->lock);
zram_free_page(zram, index);
- up_write(&zram->lock);
zram_stat64_inc(zram, &zram->stats.notify_free);
}
diff --git a/drivers/staging/zram/zram_drv.h b/drivers/staging/zram/zram_drv.h
index 87f2fec1bc94..e5cd2469b6a0 100644
--- a/drivers/staging/zram/zram_drv.h
+++ b/drivers/staging/zram/zram_drv.h
@@ -107,9 +107,8 @@ struct zram {
void *compress_buffer;
struct table *table;
spinlock_t stat64_lock; /* protect 64-bit stats */
- struct rw_semaphore lock; /* protect compression buffers, table,
- * 32bit stat counters against concurrent
- * notifications, reads and writes */
+ struct rw_semaphore lock; /* protect compression buffers and table
+ * against concurrent read and writes */
struct request_queue *queue;
struct gendisk *disk;
int init_done;