Commit 0828e38f authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] direct-io bio_add_page fix

From Badari.

bio_add_page returns zero on failure - we need to propagate that
to the dio_bio_add_page() caller.
parent eb2b0b9a
......@@ -410,9 +410,11 @@ static int dio_new_bio(struct dio *dio, sector_t blkno)
}
/*
* Attempt tp put the current chunk of 'cur_page' into the current BIO. If
* Attempt to put the current chunk of 'cur_page' into the current BIO. If
* that was successful then update final_block_in_bio and take a ref against
* the just-added page.
*
* Return zero on success. Non-zero means the caller needs to start a new BIO.
*/
static int dio_bio_add_page(struct dio *dio)
{
......@@ -426,6 +428,8 @@ static int dio_bio_add_page(struct dio *dio)
dio->final_block_in_bio = dio->cur_page_block +
(dio->cur_page_len >> dio->blkbits);
ret = 0;
} else {
ret = 1;
}
return ret;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment