[PATCH] Apply blk_partition_remap to REQ_OP_ZONE_RESET

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When a Reset WP is requested from a partition offset the blk_partition_remap
should be applied.

Signed-off-by: Shaun Tancheff <shaun.tancheff@xxxxxxxxxxx>
---
Based on for-4.10/block
---
 block/blk-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 473dd69..3f85320 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1786,8 +1786,9 @@ static blk_qc_t blk_queue_bio(struct request_queue *q, struct bio *bio)
 static inline void blk_partition_remap(struct bio *bio)
 {
 	struct block_device *bdev = bio->bi_bdev;
+	bool remap = bio_sectors(bio) != 0 || bio_op(bio) == REQ_OP_ZONE_RESET;
 
-	if (bio_sectors(bio) && bdev != bdev->bd_contains) {
+	if (remap && bdev != bdev->bd_contains) {
 		struct hd_struct *p = bdev->bd_part;
 
 		bio->bi_iter.bi_sector += p->start_sect;
-- 
2.10.2

--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux