Skip to content

Commit 85f6d5b

Browse files
bmarzinsMikulas Patocka
authored andcommitted
dm-table: check BLK_FEAT_ATOMIC_WRITES inside limits_lock
dm_set_device_limits() should check q->limits.features for BLK_FEAT_ATOMIC_WRITES while holding q->limits_lock, like it does for the rest of the queue limits. Fixes: b7c18b1 ("dm-table: Set BLK_FEAT_ATOMIC_WRITES for target queue limits") Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
1 parent 050a3e7 commit 85f6d5b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/md/dm-table.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,13 +430,13 @@ static int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
430430
return 0;
431431
}
432432

433+
mutex_lock(&q->limits_lock);
433434
/*
434435
* BLK_FEAT_ATOMIC_WRITES is not inherited from the bottom device in
435436
* blk_stack_limits(), so do it manually.
436437
*/
437438
limits->features |= (q->limits.features & BLK_FEAT_ATOMIC_WRITES);
438439

439-
mutex_lock(&q->limits_lock);
440440
if (blk_stack_limits(limits, &q->limits,
441441
get_start_sect(bdev) + start) < 0)
442442
DMWARN("%s: adding target device %pg caused an alignment inconsistency: "

0 commit comments

Comments
 (0)