summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2019-03-17 18:01:04 +0800
committerJens Axboe <axboe@kernel.dk>2019-04-01 12:11:17 -0600
commitdb5ebd6edd2627d7e81a031643cf43587f63e66c (patch)
treefdd26a5eb5d832877fcf432eded227becf68b896
parent0383ad4374f7ad7edd925a2ee4753035c3f5508a (diff)
downloadlinux-db5ebd6edd2627d7e81a031643cf43587f63e66c.tar.gz
linux-db5ebd6edd2627d7e81a031643cf43587f63e66c.tar.bz2
linux-db5ebd6edd2627d7e81a031643cf43587f63e66c.zip
block: avoid to break XEN by multi-page bvec
XEN has special page merge requirement, see xen_biovec_phys_mergeable(). We can't merge pages into one bvec simply for XEN. So move XEN's specific check on page merge into __bio_try_merge_page(), then abvoid to break XEN by multi-page bvec. Cc: ris Ostrovsky <boris.ostrovsky@oracle.com> Cc: xen-devel@lists.xenproject.org Cc: Omar Sandoval <osandov@fb.com> Cc: Christoph Hellwig <hch@lst.de> Reviewed-by: Juergen Gross <jgross@suse.com> Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--block/bio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/bio.c b/block/bio.c
index b64cedc7f87c..b2423e7aae08 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -776,6 +776,8 @@ bool __bio_try_merge_page(struct bio *bio, struct page *page,
if (vec_end_addr + 1 != page_addr + off)
return false;
+ if (xen_domain() && !xen_biovec_phys_mergeable(bv, page))
+ return false;
if (same_page && (vec_end_addr & PAGE_MASK) != page_addr)
return false;