On Tuesday November 14, [EMAIL PROTECTED] wrote:
> On Tuesday November 14, [EMAIL PROTECTED] wrote:
> > 
> > Hello,
> > 
> > this is getting more and more annoying.
> > 
> > Somewhere in the stack reiserfs-dm-md-hd[bd] lies the problem that's 
> > causing "bio too big device dm-10 (256 > 255)" errors, which cause i/o 
> > failures.
> > 
> > It works as expected on reiserfs-dm-sda and on ext3-dm-md-hd[bd].
> > 
> > Debian Etch, 2.6.17-2.
> > 
> 
> Please try this patch (I can give more detailed instructions if needed).
> 

Of course, that patch didn't even compile :-(

This one does.

NeilBrown

-------------------
Make sure dm honours max_hw_sectors of underlying devices


Signed-off-by: Neil Brown <[EMAIL PROTECTED]>

### Diffstat output
 ./drivers/md/dm-table.c         |    7 +++++++
 ./include/linux/device-mapper.h |    1 +
 2 files changed, 8 insertions(+)

diff .prev/drivers/md/dm-table.c ./drivers/md/dm-table.c
--- .prev/drivers/md/dm-table.c 2006-11-17 16:48:34.000000000 +1100
+++ ./drivers/md/dm-table.c     2006-11-17 16:45:53.000000000 +1100
@@ -99,6 +99,9 @@ static void combine_restrictions_low(str
        lhs->max_segment_size =
                min_not_zero(lhs->max_segment_size, rhs->max_segment_size);
 
+       lhs->max_hw_sectors =
+               min_not_zero(lhs->max_hw_sectors, rhs->max_hw_sectors);
+
        lhs->seg_boundary_mask =
                min_not_zero(lhs->seg_boundary_mask, rhs->seg_boundary_mask);
 
@@ -561,6 +564,9 @@ void dm_set_device_limits(struct dm_targ
        rs->max_segment_size =
                min_not_zero(rs->max_segment_size, q->max_segment_size);
 
+       rs->max_hw_sectors =
+               min_not_zero(rs->max_hw_sectors, q->max_hw_sectors);
+
        rs->seg_boundary_mask =
                min_not_zero(rs->seg_boundary_mask,
                             q->seg_boundary_mask);
@@ -889,6 +895,7 @@ void dm_table_set_restrictions(struct dm
        q->max_hw_segments = t->limits.max_hw_segments;
        q->hardsect_size = t->limits.hardsect_size;
        q->max_segment_size = t->limits.max_segment_size;
+       q->max_hw_sectors = t->limits.max_hw_sectors;
        q->seg_boundary_mask = t->limits.seg_boundary_mask;
        if (t->limits.no_cluster)
                q->queue_flags &= ~(1 << QUEUE_FLAG_CLUSTER);

diff .prev/include/linux/device-mapper.h ./include/linux/device-mapper.h
--- .prev/include/linux/device-mapper.h 2006-11-17 16:48:34.000000000 +1100
+++ ./include/linux/device-mapper.h     2006-11-17 16:48:41.000000000 +1100
@@ -113,6 +113,7 @@ struct io_restrictions {
        unsigned short          max_hw_segments;
        unsigned short          hardsect_size;
        unsigned int            max_segment_size;
+       unsigned int            max_hw_sectors;
        unsigned long           seg_boundary_mask;
        unsigned char           no_cluster; /* inverted so that 0 is default */
 };
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to