Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
fork

Configure Feed

Select the types of activity you want to include in your feed.

DM: Fix device mapper topology stacking

Make DM use bdev_stack_limits() function so that partition offsets get
taken into account when calculating alignment. Clarify stacking
warnings.

Also remove obsolete clearing of final alignment_offset and misalignment
flag.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: Alasdair G. Kergon <agk@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

authored by

Martin K. Petersen and committed by
Jens Axboe
b27d7f16 17be8c24

+5 -15
+5 -15
drivers/md/dm-table.c
··· 503 503 return 0; 504 504 } 505 505 506 - if (blk_stack_limits(limits, &q->limits, start << 9) < 0) 507 - DMWARN("%s: target device %s is misaligned: " 506 + if (bdev_stack_limits(limits, bdev, start) < 0) 507 + DMWARN("%s: adding target device %s caused an alignment inconsistency: " 508 508 "physical_block_size=%u, logical_block_size=%u, " 509 509 "alignment_offset=%u, start=%llu", 510 510 dm_device_name(ti->table->md), bdevname(bdev, b), 511 511 q->limits.physical_block_size, 512 512 q->limits.logical_block_size, 513 513 q->limits.alignment_offset, 514 - (unsigned long long) start << 9); 515 - 514 + (unsigned long long) start << SECTOR_SHIFT); 516 515 517 516 /* 518 517 * Check if merge fn is supported. ··· 1025 1026 * for the table. 1026 1027 */ 1027 1028 if (blk_stack_limits(limits, &ti_limits, 0) < 0) 1028 - DMWARN("%s: target device " 1029 + DMWARN("%s: adding target device " 1029 1030 "(start sect %llu len %llu) " 1030 - "is misaligned", 1031 + "caused an alignment inconsistency", 1031 1032 dm_device_name(table->md), 1032 1033 (unsigned long long) ti->begin, 1033 1034 (unsigned long long) ti->len); ··· 1078 1079 void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, 1079 1080 struct queue_limits *limits) 1080 1081 { 1081 - /* 1082 - * Each target device in the table has a data area that should normally 1083 - * be aligned such that the DM device's alignment_offset is 0. 1084 - * FIXME: Propagate alignment_offsets up the stack and warn of 1085 - * sub-optimal or inconsistent settings. 1086 - */ 1087 - limits->alignment_offset = 0; 1088 - limits->misaligned = 0; 1089 - 1090 1082 /* 1091 1083 * Copy table's limits to the DM device's request_queue 1092 1084 */