summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorHu hui <b29976@freescale.com>2010-10-20 09:49:47 +0800
committerJason Liu <r64343@freescale.com>2012-07-20 13:10:15 +0800
commit82e69e6fc05fe9075dc9312cf2fdd3fe38d34ff5 (patch)
treef92395fdd82a03ae84684dd36c5ff7366c7086b4 /drivers/block
parentba35d569a195ce2373171411a1f9821c56f620bf (diff)
ENGR00132493 RAMDISK: doing write barrier will return -EIO
when doing write barrier, the data of the bio is NULL, it's OK for ramdisk doing nothing, So the result of the bio must be success. Signed-off-by: Hu Hui <b29976@freescale.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/brd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index dba1c32e1ddf..1539aab03799 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -331,12 +331,14 @@ static int brd_make_request(struct request_queue *q, struct bio *bio)
struct bio_vec *bvec;
sector_t sector;
int i;
- int err = -EIO;
+ int err = 0;
sector = bio->bi_sector;
if (sector + (bio->bi_size >> SECTOR_SHIFT) >
- get_capacity(bdev->bd_disk))
+ get_capacity(bdev->bd_disk)) {
+ err = -EIO;
goto out;
+ }
if (unlikely(bio->bi_rw & REQ_DISCARD)) {
err = 0;