]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
dm zoned: assign max_io_len correctly
authorHou Tao <houtao1@huawei.com>
Mon, 15 Jun 2020 03:33:23 +0000 (11:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jul 2020 07:39:40 +0000 (09:39 +0200)
commit 7b2377486767503d47265e4d487a63c651f6b55d upstream.

The unit of max_io_len is sector instead of byte (spotted through
code review), so fix it.

Fixes: 3b1a94c88b79 ("dm zoned: drive-managed zoned block device target")
Cc: stable@vger.kernel.org
Signed-off-by: Hou Tao <houtao1@huawei.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-zoned-target.c

index f4f83d39b3dcf03d2736fa762ded17160e0e56a2..29881fea6acbd9ce9ac9ada094ed87a91e6858e9 100644 (file)
@@ -790,7 +790,7 @@ static int dmz_ctr(struct dm_target *ti, unsigned int argc, char **argv)
        }
 
        /* Set target (no write same support) */
-       ti->max_io_len = dev->zone_nr_sectors << 9;
+       ti->max_io_len = dev->zone_nr_sectors;
        ti->num_flush_bios = 1;
        ti->num_discard_bios = 1;
        ti->num_write_zeroes_bios = 1;