]> www.infradead.org Git - users/jedix/linux-maple.git/commit
nvme: fix write_stream_granularity initialization
authorCaleb Sander Mateos <csander@purestorage.com>
Tue, 6 May 2025 17:54:12 +0000 (11:54 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 6 May 2025 19:13:49 +0000 (13:13 -0600)
commit86b6e0bd1a69efd0ed408997e0adfb85df96a0c7
treebc9106f5e2c75b6926b87360d48dc5aee9bbbefc
parent38e8397dde6338c76593ddb17ccf3118fc3f5203
nvme: fix write_stream_granularity initialization

write_stream_granularity is set to max(info->runs, U32_MAX), which means
that any RUNS value less than 2 ** 32 becomes U32_MAX, and any larger
value is silently truncated to an unsigned int.

Use min() instead to provide the correct semantics, capping RUNS values
at U32_MAX.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Fixes: 30b5f20bb2dd ("nvme: register fdp parameters with the block layer")
Reviewed-by: Keith Busch <kbusch@kernel.org>
Link: https://lore.kernel.org/r/20250506175413.1936110-1-csander@purestorage.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/core.c