mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
vfs: guard end of device for mpage interface
Add guard_bio_eod() check for mpage code in order to allow us to do IO even on the odd last sectors of a device, even if the block size is some multiple of the physical sector size. Using mpage_readpages() for block device requires this guard check. Signed-off-by: Akinobu Mita <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Alexander Viro <[email protected]> Cc: Jeff Moyer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
59d43914ed
commit
4db96b71e3
3 changed files with 8 additions and 1 deletions
|
|
@ -28,6 +28,7 @@
|
|||
#include <linux/backing-dev.h>
|
||||
#include <linux/pagevec.h>
|
||||
#include <linux/cleancache.h>
|
||||
#include "internal.h"
|
||||
|
||||
/*
|
||||
* I/O completion handler for multipage BIOs.
|
||||
|
|
@ -57,6 +58,7 @@ static void mpage_end_io(struct bio *bio, int err)
|
|||
static struct bio *mpage_bio_submit(int rw, struct bio *bio)
|
||||
{
|
||||
bio->bi_end_io = mpage_end_io;
|
||||
guard_bio_eod(rw, bio);
|
||||
submit_bio(rw, bio);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue