Re: [PATCH 1/2] block: modify blk_mq_plug() to allow only reads for zoned block devices

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

 



On 9/26/22 03:53, Pankaj Raghav wrote:
Modify blk_mq_plug() to allow plugging only for read operations in zoned
block devices as there are alternative IO paths in the linux block
layer which can end up doing a write via driver private requests in
sequential write zones.

Signed-off-by: Pankaj Raghav <p.raghav@xxxxxxxxxxx>
---
  block/blk-mq.h | 7 ++++---
  1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/block/blk-mq.h b/block/blk-mq.h
index 8ca453ac243d..005343df64ca 100644
--- a/block/blk-mq.h
+++ b/block/blk-mq.h
@@ -305,14 +305,15 @@ static inline void blk_mq_clear_mq_map(struct blk_mq_queue_map *qmap)
   * change can cause write BIO failures with zoned block devices as these
   * require sequential write patterns to zones. Prevent this from happening by
   * ignoring the plug state of a BIO issuing context if it is for a zoned block
- * device and the BIO to plug is a write operation.
+ * device and the BIO to plug is not a read operation.
+ *
   *
   * Return current->plug if the bio can be plugged and NULL otherwise
   */
  static inline struct blk_plug *blk_mq_plug( struct bio *bio)
  {
-	/* Zoned block device write operation case: do not plug the BIO */
-	if (bdev_is_zoned(bio->bi_bdev) && op_is_write(bio_op(bio)))
+	/* Allow plugging only for read operations in zoned block devices */

nit: s/in/with

+	if (bdev_is_zoned(bio->bi_bdev) && bio_op(bio) != REQ_OP_READ)
  		return NULL;
/*

Otherwise, looks good to me.

Reviewed-by: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx>

--
Damien Le Moal
Western Digital Research




[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