diff options
Diffstat (limited to 'fs/buffer.c')
| -rw-r--r-- | fs/buffer.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index 89a4e42b9aad..ce357602f471 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
| @@ -3027,6 +3027,13 @@ void guard_bio_eod(int op, struct bio *bio) | |||
| 3027 | /* Uhhuh. We've got a bio that straddles the device size! */ | 3027 | /* Uhhuh. We've got a bio that straddles the device size! */ |
| 3028 | truncated_bytes = bio->bi_iter.bi_size - (maxsector << 9); | 3028 | truncated_bytes = bio->bi_iter.bi_size - (maxsector << 9); |
| 3029 | 3029 | ||
| 3030 | /* | ||
| 3031 | * The bio contains more than one segment which spans EOD, just return | ||
| 3032 | * and let IO layer turn it into an EIO | ||
| 3033 | */ | ||
| 3034 | if (truncated_bytes > bvec->bv_len) | ||
| 3035 | return; | ||
| 3036 | |||
| 3030 | /* Truncate the bio.. */ | 3037 | /* Truncate the bio.. */ |
| 3031 | bio->bi_iter.bi_size -= truncated_bytes; | 3038 | bio->bi_iter.bi_size -= truncated_bytes; |
| 3032 | bvec->bv_len -= truncated_bytes; | 3039 | bvec->bv_len -= truncated_bytes; |
