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=1796384324; b=p6FTk3WLllsxCQLjCvxbNVK+fhVCU1L83mMNRx8njkOa8xP/+m8gye0KEacg+0Ou5hO8 4EEqXEMB8rdskBakgMJyUNScjjIUHk/v+Hkk0maf07ncUpakTeKMUmMGq0G7nCOVn4AUF 3S8JIREPb+4Iw4ZMeGidyJeowT8P+nsqOhqdQXZE4POq0RlU1AoiIotsDNDQdkztas9eR pH4vey6I0gB8ZQfjtu9SvNojHH5DW3lxTDhUqlE3jwFArSs3jIZu+Mnm2I2CietxyiZkf ercR29BoyaW1ltrnEsu68ec0KBHudO0EIyjWhvrwLvxvSeam/W6RqID5/yxAw29uXog== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384324; 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=byFPLXZWHx/rNKO48kxtL5vcIDAtzfeCPmPKG09+390=; b=0fxU34dX1aYeVMOVbOH5/tb+fFKa7umMBEcVVCOXhq+h/a/pjJp/Q/tgSOm4W0udiX1x ZZOrXSUpeONEb/uPWx8Nby3S88gEg3v2ZRYVp+xNFTnRFyWjHJYth6UCF8vki3pnKx8by p2jkQp4/oQGAQQKklZ+3HGZjBuyjup8++zJvvUNHT1Naj/5XxaNknvnOn6+z50paULhd1 Or+OOq0LVsHvLZU22t2Y5WEYyqkguIMgb0C4DGpNG2FQy4p4vEnuD+qQy/pCAYdpKlN9+ 4eWonFM6SHJFcb9CFkUARbcnuLN/85EFXm6IPpEjD7ndvrCH/gxaPCG2SlTi/yP+7rw== 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=ZKtzLWmk; 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 78559606A339; Fri, 4 Dec 2026 11:38:44 +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=ZKtzLWmk Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5F381F00931; Fri, 4 Dec 2026 11:38:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384324; bh=byFPLXZWHx/rNKO48kxtL5vcIDAtzfeCPmPKG09+390=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ZKtzLWmkl5y/kw4DCmLQq/VFTiClm/gZey5xE0akB+VVDMsusAI17D0S4avzm/bKd 9pSW5Nzd61IFdnh0y57KvLfb7yZgnZGNL2bAsQdQmuznltdsKC6TdZ+BmqFREydfse o8q6nVlVD/0VUyph7yHovKn0Itb9paG3ZdGgmscc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yuho Choi , Stefan Hajnoczi , "Michael S. Tsirkin" , Sasha Levin Subject: [PATCH 6.6 0102/1167] virtio_blk: Reset device on probe error paths after DRIVER_OK Date: Fri, 4 Dec 2026 18:52:09 +0900 Message-ID: <20261204100704.752803457@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: Yuho Choi [ Upstream commit f4f6e9a9cb349003d333f0776de94f12ac95b8d2 ] virtblk_probe() marks the device ready before revalidating zones and adding the disk, and either of those can fail. The out_cleanup_disk path they take goes on to delete the virtqueues, but nothing tells the device to stop first, so it is still live when the rings are freed. Reset the device at out_cleanup_disk, which is only reachable after virtio_device_ready(). virtblk_remove() and virtblk_freeze_priv() both reset before deleting the virtqueues for the same reason. Fixes: dbb301f91fc8 ("virtio_blk: add error handling support for add_disk()") Signed-off-by: Yuho Choi Reviewed-by: Stefan Hajnoczi Signed-off-by: Michael S. Tsirkin Message-ID: <20260922211207.523999-1-oss.patchbox@gmail.com> Signed-off-by: Sasha Levin --- drivers/block/virtio_blk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 1aeb44304f37a..49ce9ef8e8cfb 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -1580,6 +1580,7 @@ static int virtblk_probe(struct virtio_device *vdev) return 0; out_cleanup_disk: + virtio_reset_device(vdev); put_disk(vblk->disk); out_free_tags: blk_mq_free_tag_set(&vblk->tag_set); -- 2.53.0