Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp585971pxk; Wed, 2 Sep 2020 09:23:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLrMoDYugFIGxpGAJiPqP/N51PML05f1T1DKo6LRCNJ/XtLmdRhN8kDb7nKt931XxT3Byb X-Received: by 2002:a17:906:288d:: with SMTP id o13mr813828ejd.195.1599063819145; Wed, 02 Sep 2020 09:23:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599063819; cv=none; d=google.com; s=arc-20160816; b=M1NmDAUjPhC37KxwoPQPuET/vGCbeG6rV8QNwsFGR6Wj8uQc5fw5/ngZ98HmaYjFmP BK0P4R5HWJZHmZB+Tbf9bmt6qWEcoE/oGkhegC61RAwKJj0Pjt2FhfDD65U2RcJjkBbd HdX5Fz69B7M7Q/IYSvTIIP1mIltzMUgIFEK3wASBX8QdKrZ4J8KFxYjr6kxjcHbXpjrE 6RWJSmHHoPCMh3Nm8P8amGWIUdNpGasKu6SGcJCPGRGmjEoT+FIGptl3JjAJgKRJ61XU n7Ugj1+3ppZnpfREIAt7bnZmCRiILODNVAvLqawvxp8aA23zVhc64nQ2nwN3jQF35EWW yYRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=A4Ns4FXyKzBbQIQFhXeIN99gK1TEB4bN7K2rZb3tfqs=; b=ckvv6XE1AhmR+eSKKDN/5Jvch7jDDq1+xHTPELnwyFDzloquLs3rveeukr2NDcIQfT NhEUZev72Bc+AGZU0UjbW+Mitvf6jh0VRrtG3K2tRq4aFH1qGJI/8IR9wfgUaV4YzSwt gV0kIN+vo3Lc8FdU0cQDre6bq3iYBnxEs+11d7QGREop2HM+A3f95zN8tYAhwnh8R+6U 1bB300riOBiRYFmLQv5eotD4EC5pUKazxyhXUt65ryEFWodOdsCXWDCsJQN+3ty/pV/X 4ebq4DvwpmF6Cj6SB0RIRqO9SGX5yfR4J8ofBuE7OzNuposLpFA7BMGKZr2VBCM5X9zG 4v0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tBR2n6hv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n8si2840046edv.195.2020.09.02.09.23.16; Wed, 02 Sep 2020 09:23:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tBR2n6hv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728940AbgIBQTZ (ORCPT + 99 others); Wed, 2 Sep 2020 12:19:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726814AbgIBQTV (ORCPT ); Wed, 2 Sep 2020 12:19:21 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D9CEC061244; Wed, 2 Sep 2020 09:19:21 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id f127so107414lfd.7; Wed, 02 Sep 2020 09:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=A4Ns4FXyKzBbQIQFhXeIN99gK1TEB4bN7K2rZb3tfqs=; b=tBR2n6hvrbBmXRV3KYYvZLMZe1zksCcBHJSuVij9v/Mfx0mjvXpvKQv+n2NjGjB5+7 FUlvE06p5sp9p7lyyIWi2rgXvbZt8LHbpMfb31wmHq2MfE2dN19KZjip4hM9j1mjci7b 4ne3Nb7NNiRJSUh+wLALVk4vZsU1Ajv1tiTjTq6NzgX7BjYPwRrhcbzY0D+CobKQFM5v 8XGrSnvqb5C7xMnlLSeEs0UBZ29+9TXxGbshDEYoHp3P1wd6/6YZ2fziqnj3SZstZtRE x6ZYyh15XZdwqOUWKRSnXUgcM7FViI71QM9cYJmMkibTmGfYjd+IhDtQgPUPE8dXMjn3 7Q8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=A4Ns4FXyKzBbQIQFhXeIN99gK1TEB4bN7K2rZb3tfqs=; b=MUgVFGcsjmr0W425VRqQi7lYsvMYVVwTk+Yj3+3b+DBfnXGrqZ66LwYYb1Tqfkmc7j wsTpownH38me6I7YoR1apJZ5AZWuT/rHrEDz/DbokHypcht0GSgMXLsW/TQd+F4iMbSe qPxofvaLCQSgxg8xCaBzuX8mgFz/sfNyJ8lHOOqXK3F7rgD/txrQQL4pnLbBoqQxR0G1 woaSlUfevydf5eLuE3odqFVaUSJZ8Fh0cKPgRv2aLC69D+x95ujEDdd7p6urUX5YlWtU Q3t1W5+7B9rmYPPw9Jl1D4+svDwu0MHG3dBq50MeefFNMKqeIGuGQV6n4TxZs3JWblrr oJ7w== X-Gm-Message-State: AOAM533ik1s+alzTKp5THuIQ7Nk2WWivCwHlW6OzdGMk316OfJEew5Tb DtCXuISmG/A6H7GNMwVWueDVd5O1JyZYwQ== X-Received: by 2002:a19:dcb:: with SMTP id 194mr3481675lfn.25.1599063559361; Wed, 02 Sep 2020 09:19:19 -0700 (PDT) Received: from wasted.omprussia.ru ([2a00:1fa0:44ba:bd37:6990:9f35:8864:71b0]) by smtp.gmail.com with ESMTPSA id d6sm19235ljg.25.2020.09.02.09.19.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Sep 2020 09:19:18 -0700 (PDT) Subject: Re: [PATCH 16/19] sd: use bdev_check_media_change To: Christoph Hellwig , Jens Axboe Cc: Denis Efremov , Tim Waugh , Michal Simek , Borislav Petkov , "David S. Miller" , Song Liu , "Martin K. Petersen" , Finn Thain , Michael Schmitz , linux-m68k@lists.linux-m68k.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, linux-raid@vger.kernel.org, linux-scsi@vger.kernel.org, linux-fsdevel@vger.kernel.org References: <20200902141218.212614-1-hch@lst.de> <20200902141218.212614-17-hch@lst.de> From: Sergei Shtylyov Message-ID: <1b972d93-e8e3-8f32-86de-76792948e20b@gmail.com> Date: Wed, 2 Sep 2020 19:19:17 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200902141218.212614-17-hch@lst.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/2/20 5:12 PM, Christoph Hellwig wrote: > Switch to use bdev_check_media_change instead of check_disk_change and > call cd_revalidate_disk manually. As sd also calls sd_revalidate_disk s/cd/sd/? > manually during probe and open, , the extra call into ->revalidate_disk > from bdev_disk_changed is not required either, so stop wiring up the > method. > > Signed-off-by: Christoph Hellwig > --- > drivers/scsi/sd.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c > index 2bec8cd526164d..d020639c28c6ca 100644 > --- a/drivers/scsi/sd.c > +++ b/drivers/scsi/sd.c > @@ -1381,8 +1381,10 @@ static int sd_open(struct block_device *bdev, fmode_t mode) > if (!scsi_block_when_processing_errors(sdev)) > goto error_out; > > - if (sdev->removable || sdkp->write_prot) > - check_disk_change(bdev); > + if (sdev->removable || sdkp->write_prot) { > + if (bdev_check_media_change(bdev)) > + sd_revalidate_disk(bdev->bd_disk); > + } > > /* > * If the drive is empty, just let the open fail. [...] MBR, Sergei