]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
block: fix op_is_zone_mgmt() to handle REQ_OP_ZONE_RESET_ALL
authorDamien Le Moal <dlemoal@kernel.org>
Mon, 27 Oct 2025 00:27:32 +0000 (09:27 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:36:43 +0000 (15:36 -0500)
commit 12a1c9353c47c0fb3464eba2d78cdf649dee1cf7 upstream.

REQ_OP_ZONE_RESET_ALL is a zone management request. Fix
op_is_zone_mgmt() to return true for that operation, like it already
does for REQ_OP_ZONE_RESET.

While no problems were reported without this fix, this change allows
strengthening checks in various block device drivers (scsi sd,
virtioblk, DM) where op_is_zone_mgmt() is used to verify that a zone
management command is not being issued to a regular block device.

Fixes: 6c1b1da58f8c ("block: add zone open, close and finish operations")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/blk_types.h

index f78145be77df5c779b85e0830756fc38dd67664d..d10546e2e6db5881488377874c23e0bf87e7b5a4 100644 (file)
@@ -480,6 +480,7 @@ static inline bool op_is_zone_mgmt(enum req_op op)
 {
        switch (op & REQ_OP_MASK) {
        case REQ_OP_ZONE_RESET:
+       case REQ_OP_ZONE_RESET_ALL:
        case REQ_OP_ZONE_OPEN:
        case REQ_OP_ZONE_CLOSE:
        case REQ_OP_ZONE_FINISH: