Commit 25f532b9 authored by Kevin Corry's avatar Kevin Corry Committed by Linus Torvalds

[PATCH] Fix DM on top of raid

Force Device-Mapper to use PAGE_SIZE or smaller I/O when the underlying
device has a bvec_merge_fn routine registered.  This will fix the
situation of Device-Mapper submitting I/Os to RAID-0 that span the
RAID-0 chunk boundaries.

Joe is working on a better solution that actually honors the MD
merge_bvec_fn routine.  But this minimal change will fix the problem for
the time being.
parent 1290f52b
...@@ -489,6 +489,18 @@ int dm_get_device(struct dm_target *ti, const char *path, sector_t start, ...@@ -489,6 +489,18 @@ int dm_get_device(struct dm_target *ti, const char *path, sector_t start,
rs->max_sectors = rs->max_sectors =
min_not_zero(rs->max_sectors, q->max_sectors); min_not_zero(rs->max_sectors, q->max_sectors);
/* FIXME: Device-Mapper on top of RAID-0 breaks because DM
* currently doesn't honor MD's merge_bvec_fn routine.
* In this case, we'll force DM to use PAGE_SIZE or
* smaller I/O, just to be safe. A better fix is in the
* works, but add this for the time being so it will at
* least operate correctly.
*/
if (q->merge_bvec_fn)
rs->max_sectors =
min_not_zero(rs->max_sectors,
(unsigned short)(PAGE_SIZE >> 9));
rs->max_phys_segments = rs->max_phys_segments =
min_not_zero(rs->max_phys_segments, min_not_zero(rs->max_phys_segments,
q->max_phys_segments); q->max_phys_segments);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment