Received: by 2002:a05:7412:8d08:b0:f9:2d0a:d759 with SMTP id bj8csp222318rdb; Sun, 17 Dec 2023 08:57:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IGOpwhRtmHeTRa6hLVo8nRjBX9CZb4mIn1NRdE0knv85xeNHCIqxq6ErQGgj3RJp1F8tht7 X-Received: by 2002:a05:6a20:3948:b0:190:13db:f460 with SMTP id r8-20020a056a20394800b0019013dbf460mr8410592pzg.9.1702832243651; Sun, 17 Dec 2023 08:57:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702832243; cv=none; d=google.com; s=arc-20160816; b=plpDofr7KVGtwJwEbJL7Xs9fxFUAWDZ8csfKnifG2en9VZeaOWCUuMbIgd2+XvRdgV kdGpXxkVcoLyFeP3BQfZITtFloc5z7UxCIyDcZ7Otc0O4A1PKrczUqUSIlxERkVXv0Jn 01OjKjkRO9n1+EZQPTMrvR/47rKYz/4UhTTEW3g+bdbFW4oCrwEKLXStea4+NVQEB8q2 7Pc7tFhMBt5b71zlO2splJwcqosVAhvJSpvLgsfkeRD/MYXNqiFHGhqIOcuVIoLDdqpK aSbFRe88Ofu+YUyAJwEaRVnU6G8EiaTUcS6KWeVtTuv2TfXiyG0/7k+4C9YI1dqxZN4U lQEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ctU7eNWyO5uU8k+K1R2TcQkMR0gAuYk2v8Yjsja/Y1c=; fh=Qt7f1uSggTs9+L2cHwIDejIvdddX1p6luRHcdzQ226s=; b=LE+Hmmf57qNqFvQN0qkEpd1ZzhF4dro27dSA59enQT+BME79w0O6DLg+ZjyotSr9+5 sFQh5IHAYlIY/pW6ZmdTlFoyxOKGg5oiGuQoeo67f2TZFXx622DQ48TjQMSxHMlqSqsK GqFdker7QKxQ9lwhdnjTxoI9G2iyCP1rzv/Qd0ODzMh1aGafoB3Z1wSMjvqNZSNJ16yl nN4yLV/mOXI3a0XSTfhOZ1ihg4nn9VEBOxtkRSDa2YUy22GC7Q77v2xOYmrjLxAh3yfi Yvp4O5qjcNnbyAor7v9PnbjWWANaES9n906mJ6fvSCn4JLolgld2m2Zy/HfBi5fWAl17 b2sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=DXYqZVLT; spf=pass (google.com: domain of linux-kernel+bounces-2687-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2687-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id i8-20020a1709026ac800b001cfdf2e382bsi16378654plt.209.2023.12.17.08.57.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 08:57:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2687-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=DXYqZVLT; spf=pass (google.com: domain of linux-kernel+bounces-2687-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2687-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B0246B224B3 for ; Sun, 17 Dec 2023 16:57:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC6B749F7D; Sun, 17 Dec 2023 16:54:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="DXYqZVLT" X-Original-To: linux-kernel@vger.kernel.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B961648CE8; Sun, 17 Dec 2023 16:54:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=ctU7eNWyO5uU8k+K1R2TcQkMR0gAuYk2v8Yjsja/Y1c=; b=DXYqZVLTY3AXEoBxl64SMyaX8s iocWPDWI6wSF+Py9Nzd53oAjEW8s1qbVJSoFuHgjMO7ReyYzIlvWagT4aJ/QmwFjj50jACktmkLZZ 71o5L28Kq7RX+chawOPRKpL2T53erXPKzIXI2nvXIoChjJLg+xemJqSISQODlbdXJhjhX3utH0SCb szSXCMLib0iNpU+rrWEUHdVpkSQBb6SomuF0Kui47LLE3g4uh80BP5X4zJwwPeRq3X5kFrKbtgrF7 l9Bbdlk6oGly95fNPZZVTL8laT37R0kjKKAPdOWDe6Ywyiy/a+PBeQwlF7aweLD4aibb3mJ7/+CUa zv8VYmog==; Received: from [88.128.92.84] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rEuPB-0088Od-1n; Sun, 17 Dec 2023 16:54:17 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Paolo Bonzini , Stefan Hajnoczi , Damien Le Moal , "Martin K. Petersen" , dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org, virtualization@lists.linux.dev, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH 5/5] sd: only call disk_clear_zoned when needed Date: Sun, 17 Dec 2023 17:53:59 +0100 Message-Id: <20231217165359.604246-6-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231217165359.604246-1-hch@lst.de> References: <20231217165359.604246-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html disk_clear_zoned only needs to be called when a device reported zone managed mode first and we clear it. Add a check so that disk_clear_zoned isn't called on devices that were never zoned. This avoids a fairly expensive queue freezing when revalidating conventional devices. Signed-off-by: Christoph Hellwig --- drivers/scsi/sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index dbed075cdb981a..8c8ac5cd1833b4 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -3149,7 +3149,7 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp) * the device physical block size. */ blk_queue_zone_write_granularity(q, sdkp->physical_block_size); - } else { + } else if (blk_queue_is_zoned(q)) { /* * Anything else. This includes host-aware device that we treat * as conventional. -- 2.39.2