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

Configure Feed

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

dm: lock limits when reading them

Lock queue limits when reading them, so that we don't read halfway
modified values.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org

+7 -1
+7 -1
drivers/md/dm-table.c
··· 431 431 return 0; 432 432 } 433 433 434 + mutex_lock(&q->limits_lock); 434 435 if (blk_stack_limits(limits, &q->limits, 435 436 get_start_sect(bdev) + start) < 0) 436 437 DMWARN("%s: adding target device %pg caused an alignment inconsistency: " ··· 449 448 */ 450 449 if (!dm_target_has_integrity(ti->type)) 451 450 queue_limits_stack_integrity_bdev(limits, bdev); 451 + mutex_unlock(&q->limits_lock); 452 452 return 0; 453 453 } 454 454 ··· 1736 1734 sector_t start, sector_t len, void *data) 1737 1735 { 1738 1736 struct request_queue *q = bdev_get_queue(dev->bdev); 1737 + int b; 1739 1738 1740 - return !q->limits.max_write_zeroes_sectors; 1739 + mutex_lock(&q->limits_lock); 1740 + b = !q->limits.max_write_zeroes_sectors; 1741 + mutex_unlock(&q->limits_lock); 1742 + return b; 1741 1743 } 1742 1744 1743 1745 static bool dm_table_supports_write_zeroes(struct dm_table *t)