Skip to content

Commit f30e5ed

Browse files
Christoph HellwigMike Snitzer
authored andcommitted
dm-integrity: set max_integrity_segments in dm_integrity_io_hints
Set max_integrity_segments with the other queue limits instead of updating it later. This also uncovered that the driver is trying to set the limit to UINT_MAX while max_integrity_segments is an unsigned short, so fix it up to use USHRT_MAX instead. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent fa34e58 commit f30e5ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/md/dm-integrity.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3487,6 +3487,7 @@ static void dm_integrity_io_hints(struct dm_target *ti, struct queue_limits *lim
34873487
blk_limits_io_min(limits, ic->sectors_per_block << SECTOR_SHIFT);
34883488
limits->dma_alignment = limits->logical_block_size - 1;
34893489
}
3490+
limits->max_integrity_segments = USHRT_MAX;
34903491
}
34913492

34923493
static void calculate_journal_section_size(struct dm_integrity_c *ic)
@@ -3654,7 +3655,6 @@ static void dm_integrity_set(struct dm_target *ti, struct dm_integrity_c *ic)
36543655
bi.interval_exp = ic->sb->log2_sectors_per_block + SECTOR_SHIFT;
36553656

36563657
blk_integrity_register(disk, &bi);
3657-
blk_queue_max_integrity_segments(disk->queue, UINT_MAX);
36583658
}
36593659

36603660
static void dm_integrity_free_page_list(struct page_list *pl)

0 commit comments

Comments
 (0)