From: NeilBrown This flag should be set for a virtual device iff it is set for all underlying devices. Signed-off-by: Neil Brown Acked-by: Alasdair G Kergon Signed-off-by: Andrew Morton --- drivers/md/dm-table.c | 9 +++++++++ include/linux/device-mapper.h | 1 + 2 files changed, 10 insertions(+) diff -puN drivers/md/dm-table.c~dm-make-sure-queue_flag_cluster-is-set-properly drivers/md/dm-table.c --- devel/drivers/md/dm-table.c~dm-make-sure-queue_flag_cluster-is-set-properly 2006-02-23 19:43:12.000000000 -0800 +++ devel-akpm/drivers/md/dm-table.c 2006-02-23 19:43:12.000000000 -0800 @@ -97,6 +97,8 @@ static void combine_restrictions_low(str lhs->seg_boundary_mask = min_not_zero(lhs->seg_boundary_mask, rhs->seg_boundary_mask); + + lhs->no_cluster |= rhs->no_cluster; } /* @@ -525,6 +527,8 @@ int dm_get_device(struct dm_target *ti, rs->seg_boundary_mask = min_not_zero(rs->seg_boundary_mask, q->seg_boundary_mask); + + rs->no_cluster |= !test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags); } return r; @@ -834,6 +838,11 @@ void dm_table_set_restrictions(struct dm q->hardsect_size = t->limits.hardsect_size; q->max_segment_size = t->limits.max_segment_size; q->seg_boundary_mask = t->limits.seg_boundary_mask; + if (t->limits.no_cluster) + q->queue_flags &= ~(1 << QUEUE_FLAG_CLUSTER); + else + q->queue_flags |= (1 << QUEUE_FLAG_CLUSTER); + } unsigned int dm_table_get_num_targets(struct dm_table *t) diff -puN include/linux/device-mapper.h~dm-make-sure-queue_flag_cluster-is-set-properly include/linux/device-mapper.h --- devel/include/linux/device-mapper.h~dm-make-sure-queue_flag_cluster-is-set-properly 2006-02-23 19:43:12.000000000 -0800 +++ devel-akpm/include/linux/device-mapper.h 2006-02-23 19:43:12.000000000 -0800 @@ -97,6 +97,7 @@ struct io_restrictions { unsigned short hardsect_size; unsigned int max_segment_size; unsigned long seg_boundary_mask; + unsigned char no_cluster; /* inverted so that 0 is default */ }; struct dm_target { _