From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385201; b=WqfHpf2864muvCLeOOpEVWDLo+082bv9AoTixD610YeFbQnpyrq1I9oY6s+BIKY0yJm9 bPexMOhDN7is+yRaaeBTqj4m7XAIosa2Bmhoc/x2hqYtMmY6XoEvNXpPBnPzQ1ZfFW7uR fd6krMEC184EhwMPlj0D6BtB2cCSgJGxQ6AJL7vbyFzj8/HTXJKYZAqgk6V65BIoBWgg2 2+SQM4w2fphA9r7i7OM8VDTdFozdDCEj3IMdjuwzQIqfCe2oVmT1G7iIcBHnrH/7cXE2i eL7wIbIW5AkEGf/1QIHpJHLsFWnQO+ZqREdMHWfq3rLIBghKiJmO6QauedkKK25y+7g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385201; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=eOaon51vUWAwq65g2Ykt8KufmCzU4r7m43YpG+i188w=; b=uOkgL47wLK9ILJqIdFtUItW/AjE/E5jMwkh99PHgLioRs1xhyMIR+oEIc+8Um1JTBIHt QXYVSmQrZLjfZ41oI1mZnFAX+kAgDfJFsa4T8oAmfIHVyEHiFnDZgq2v/HjE+VZMCCweV 8w5kgHPUkJfeMlUqn1NozFPcuuaXyze0n8ulYtPSE2dSQfXdBdAvez+CXEFJmCuiJrncz x2RPj9cNAAnjVyoabuDBrtdH09L1lQbIkt7TAQajc4qYI1+wjStsiikeDzHxolsBI8wIk 7qB3GBkOJlCCMjk3bo2d7/b8eOtMysLF3A4nF61hGhff+a+Wv/WCbGKB3ltsEBaG1YQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=RVuOhsee; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA6B5606A32C; Fri, 4 Dec 2026 11:53:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=RVuOhsee Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E9CD1F000CE; Fri, 4 Dec 2026 11:53:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385201; bh=eOaon51vUWAwq65g2Ykt8KufmCzU4r7m43YpG+i188w=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RVuOhseeqfw6TQSCTo9W1QrhIio9UTgeeDtVaE+8KceRJzPsTXWZtbFi6QehNYXH4 uv5O8O+8NXDeqMWJWTnPW7t04WID9Um3mzkBo+sxwT2ZqvRtSYVhhQfN0zVYBMLVsn U9wCqcr00Vdrobk4eTZssY3hIiLXz3N6IQUZ/y28= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Li RongQing , Ming Lei , Jens Axboe , Sasha Levin Subject: [PATCH 6.6 0420/1167] ublk: use global index for reported zones Date: Fri, 4 Dec 2026 18:57:27 +0900 Message-ID: <20261204100712.959473716@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Li RongQing [ Upstream commit 80897c7e5ae5c56f37a2eb004328edcb4da7cdd1 ] ublk_report_zones() may split a zone report into multiple requests when the number of zones exceeds the temporary buffer capacity. The index passed to disk_report_zone() must refer to the zone position in the whole report, rather than the position within the current request. Currently, the per-request loop index is used as the callback index, causing each chunk after the first one to restart from zero. This can make userspace callbacks receive duplicate zone indices and may result in blk_revalidate_disk_zones() updating incorrect entries in its zone state array. Use the number of zones already reported as the base index for each request so that zone indices remain continuous across all chunks. Fixes: 29802d7ca33b ("ublk: enable zoned storage support") Signed-off-by: Li RongQing Reviewed-by: Ming Lei Tested-by: Ming Lei Signed-off-by: Ming Lei Link: https://patch.msgid.link/20261011063555.1142277-13-tom.leiming@gmail.com Signed-off-by: Jens Axboe [ sashal: Replaced the disk_report_zone(disk, zone, done_zones, args) call with the direct cb(zone, done_zones, data) call, since this tree has no disk_report_zone() helper. ] Signed-off-by: Sasha Levin --- drivers/block/ublk_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index 2c31ab722361d..2da3dfac9157b 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -384,7 +384,7 @@ static int ublk_report_zones(struct gendisk *disk, sector_t sector, if (!zone->len) break; - ret = cb(zone, i, data); + ret = cb(zone, done_zones, data); if (ret) goto out; -- 2.53.0