]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dm: Forbid requeue of writes to zones
authorDamien Le Moal <damien.lemoal@wdc.com>
Tue, 25 May 2021 21:24:58 +0000 (06:24 +0900)
committerMike Snitzer <snitzer@redhat.com>
Wed, 2 Jun 2021 18:18:30 +0000 (14:18 -0400)
commit2c243153d1d4be4e23735cd10984ac17c7a54531
treeb555c55c4db08dfa9711120cd5b11a531655317c
parent1697e8d750d4bf4b9e92a63d0bad7ffe1ea64b17
dm: Forbid requeue of writes to zones

A target map method requesting the requeue of a bio with
DM_MAPIO_REQUEUE or completing it with DM_ENDIO_REQUEUE can cause
unaligned write errors if the bio is a write operation targeting a
sequential zone. If a zoned target request such a requeue, warn about
it and kill the IO.

The function dm_is_zone_write() is introduced to detect write operations
to zoned targets.

This change does not affect the target drivers supporting zoned devices
and exposing a zoned device, namely dm-crypt, dm-linear and dm-flakey as
none of these targets ever request a requeue.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-zone.c
drivers/md/dm.c
drivers/md/dm.h