[PATCH][zram] Do not check for init flag before starting I/O

Nitin Gupta ngupta at vflare.org
Thu Dec 30 09:07:58 UTC 2010


zram module is unusable without this fix.

Checking for init_done flag in zram_make_request() results in a
*no-op* for any I/O operation since we simply always return
success. This flag is actually set when the first write occurs
on a zram disk which triggers its initialization.

Bug report: https://bugzilla.kernel.org/show_bug.cgi?id=25722

Reported-by: Dennis Jansen <dennis.jansen at web.de>
Signed-off-by: Nitin Gupta <ngupta at vflare.org>
---
 drivers/staging/zram/zram_drv.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
index 8c3c057..d0e9e02 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -435,12 +435,6 @@ static int zram_make_request(struct request_queue *queue, struct bio *bio)
 	int ret = 0;
 	struct zram *zram = queue->queuedata;
 
-	if (unlikely(!zram->init_done)) {
-		set_bit(BIO_UPTODATE, &bio->bi_flags);
-		bio_endio(bio, 0);
-		return 0;
-	}
-
 	if (!valid_io_request(zram, bio)) {
 		zram_stat64_inc(zram, &zram->stats.invalid_io);
 		bio_io_error(bio);
-- 
1.7.3.4




More information about the devel mailing list