[kernel] r16609 - in dists/sid/linux-2.6/debian: . patches/bugfix/all patches/series

Ben Hutchings benh at alioth.debian.org
Mon Nov 29 01:38:36 UTC 2010


Author: benh
Date: Mon Nov 29 01:38:32 2010
New Revision: 16609

Log:
dm: Deal with merge_bvec_fn in component devices better (Closes: #604457)

Added:
   dists/sid/linux-2.6/debian/patches/bugfix/all/dm-Deal-with-merge_bvec_fn-in-component-devices-bett.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/series/29

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	Sun Nov 28 23:29:22 2010	(r16608)
+++ dists/sid/linux-2.6/debian/changelog	Mon Nov 29 01:38:32 2010	(r16609)
@@ -10,6 +10,7 @@
   * [x86] KVM: VMX: Fix host userspace gsbase corruption (Closes: #604956)
   * USB: Retain device power/wakeup setting across reconfiguration;
     don't enable remote wakeup by default (Closes: #605246)
+  * dm: Deal with merge_bvec_fn in component devices better (Closes: #604457)
 
  -- Ben Hutchings <ben at decadent.org.uk>  Sat, 27 Nov 2010 21:06:54 +0000
 

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/dm-Deal-with-merge_bvec_fn-in-component-devices-bett.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/dm-Deal-with-merge_bvec_fn-in-component-devices-bett.patch	Mon Nov 29 01:38:32 2010	(r16609)
@@ -0,0 +1,57 @@
+From ed2a7328b175d902f23fc9c2f7c412d57aa70dec Mon Sep 17 00:00:00 2001
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Sun, 28 Nov 2010 23:46:46 +0000
+Subject: [PATCH] dm: Deal with merge_bvec_fn in component devices better
+
+This is analogous to commit 627a2d3c29427637f4c5d31ccc7fcbd8d312cd71,
+which does the same for md-devices at the top of the stack.  The
+following explanation is taken from that commit.  Thanks to Neil Brown
+<neilb at suse.de> for the advice.
+
+If a component device has a merge_bvec_fn then as we never call it
+we must ensure we never need to.  Currently this is done by setting
+max_sector to 1 PAGE, however this does not stop a bio being created
+with several sub-page iovecs that would violate the merge_bvec_fn.
+
+So instead set max_segments to 1 and set the segment boundary to the
+same as a page boundary to ensure there is only ever one single-page
+segment of IO requested at a time.
+
+This can particularly be an issue when 'xen' is used as it is
+known to submit multiple small buffers in a single bio.
+
+Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
+---
+ drivers/md/dm-table.c |   14 +++++++-------
+ 1 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
+index e869128..0833816 100644
+--- a/drivers/md/dm-table.c
++++ b/drivers/md/dm-table.c
+@@ -510,15 +510,15 @@ int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
+ 		       (unsigned long long) start << SECTOR_SHIFT);
+ 
+ 	/*
+-	 * Check if merge fn is supported.
+-	 * If not we'll force DM to use PAGE_SIZE or
+-	 * smaller I/O, just to be safe.
++	 * If we don't call merge_bvec_fn, we must never risk
++	 * violating it, so limit max_phys_segments to 1 lying within
++	 * a single page.
+ 	 */
++	if (q->merge_bvec_fn && !ti->type->merge) {
++		limits->max_phys_segments = 1;
++		limits->seg_boundary_mask = PAGE_CACHE_SIZE - 1;
++	}
+ 
+-	if (q->merge_bvec_fn && !ti->type->merge)
+-		limits->max_sectors =
+-			min_not_zero(limits->max_sectors,
+-				     (unsigned int) (PAGE_SIZE >> 9));
+ 	return 0;
+ }
+ EXPORT_SYMBOL_GPL(dm_set_device_limits);
+-- 
+1.7.2.3
+

Modified: dists/sid/linux-2.6/debian/patches/series/29
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/29	Sun Nov 28 23:29:22 2010	(r16608)
+++ dists/sid/linux-2.6/debian/patches/series/29	Mon Nov 29 01:38:32 2010	(r16609)
@@ -8,3 +8,4 @@
 + bugfix/x86/KVM-VMX-Fix-host-userspace-gsbase-corruption.patch
 + bugfix/all/USB-retain-power-wakeup-setting-across-reconfig.patch
 + bugfix/all/USB-don-t-enable-remote-wakeup-by-default.patch
++ bugfix/all/dm-Deal-with-merge_bvec_fn-in-component-devices-bett.patch



More information about the Kernel-svn-changes mailing list