Skip to content

Commit b579d6f

Browse files
mcgrofkeithbusch
authored andcommitted
nvmet: propagate npwg topology
Ensure we propagate npwg to the target as well instead of assuming its the same logical blocks per physical block. This ensures devices with large IUs information properly propagated on the target. Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent 4db3d75 commit b579d6f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/nvme/target/io-cmd-bdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void nvmet_bdev_set_limits(struct block_device *bdev, struct nvme_id_ns *id)
3636
*/
3737
id->nsfeat |= 1 << 4;
3838
/* NPWG = Namespace Preferred Write Granularity. 0's based */
39-
id->npwg = lpp0b;
39+
id->npwg = to0based(bdev_io_min(bdev) / bdev_logical_block_size(bdev));
4040
/* NPWA = Namespace Preferred Write Alignment. 0's based */
4141
id->npwa = id->npwg;
4242
/* NPDG = Namespace Preferred Deallocate Granularity. 0's based */

0 commit comments

Comments
 (0)