Staging: zram: make zram_read return a bio error if the device is not initialized
authorJerome Marchand <[email protected]>
Fri, 17 Dec 2010 16:03:15 +0000 (17:03 +0100)
committerGreg Kroah-Hartman <[email protected]>
Fri, 21 Jan 2011 00:07:00 +0000 (16:07 -0800)
Make zram_read() return a bio error if the device is not initialized
instead of pretending nothing happened.

Signed-off-by: Jerome Marchand <[email protected]>
Acked-by: Jeff Moyer <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/staging/zram/zram_drv.c

index 0ab931e9ee7e03ee442083c8c747f3dc7105be46..01d6dd9525813fe2e3dfd1e035e1e241a505ab8c 100644 (file)
@@ -208,8 +208,7 @@ static int zram_read(struct zram *zram, struct bio *bio)
        struct bio_vec *bvec;
 
        if (unlikely(!zram->init_done)) {
-               set_bit(BIO_UPTODATE, &bio->bi_flags);
-               bio_endio(bio, 0);
+               bio_endio(bio, -ENXIO);
                return 0;
        }