summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJerome Marchand2010-12-17 17:03:15 +0100
committerGreg Kroah-Hartman2011-01-21 01:07:00 +0100
commit1aa326640d1e91d32179310441fa3030c501d0f3 (patch)
tree14eaed82cdadf87d92333c5dd4d60f8c4cd50198 /drivers
parentStaging: zram: round up the disk size provided by user (diff)
downloadkernel-qcow2-linux-1aa326640d1e91d32179310441fa3030c501d0f3.tar.gz
kernel-qcow2-linux-1aa326640d1e91d32179310441fa3030c501d0f3.tar.xz
kernel-qcow2-linux-1aa326640d1e91d32179310441fa3030c501d0f3.zip
Staging: zram: make zram_read return a bio error if the device is not initialized
Make zram_read() return a bio error if the device is not initialized instead of pretending nothing happened. Signed-off-by: Jerome Marchand <jmarchan@redhat.com> Acked-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/zram/zram_drv.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
index 0ab931e9ee7e..01d6dd952581 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -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;
}