diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2014-10-09 18:26:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-09 22:25:53 -0400 |
commit | 4db96b71e3caea5bb39053d57683129e0682c66f (patch) | |
tree | ed8deca97f1b2beb3f73a79a8112d8819fd2df2c /fs/mpage.c | |
parent | 59d43914ed7b96255271ad6b7b735344beffa3c0 (diff) |
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 <akinobu.mita@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/mpage.c')
-rw-r--r-- | fs/mpage.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/mpage.c b/fs/mpage.c index 5f9ed622274f..3e79220babac 100644 --- a/fs/mpage.c +++ b/fs/mpage.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/backing-dev.h> | 28 | #include <linux/backing-dev.h> |
29 | #include <linux/pagevec.h> | 29 | #include <linux/pagevec.h> |
30 | #include <linux/cleancache.h> | 30 | #include <linux/cleancache.h> |
31 | #include "internal.h" | ||
31 | 32 | ||
32 | /* | 33 | /* |
33 | * I/O completion handler for multipage BIOs. | 34 | * I/O completion handler for multipage BIOs. |
@@ -57,6 +58,7 @@ static void mpage_end_io(struct bio *bio, int err) | |||
57 | static struct bio *mpage_bio_submit(int rw, struct bio *bio) | 58 | static struct bio *mpage_bio_submit(int rw, struct bio *bio) |
58 | { | 59 | { |
59 | bio->bi_end_io = mpage_end_io; | 60 | bio->bi_end_io = mpage_end_io; |
61 | guard_bio_eod(rw, bio); | ||
60 | submit_bio(rw, bio); | 62 | submit_bio(rw, bio); |
61 | return NULL; | 63 | return NULL; |
62 | } | 64 | } |