Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1023172ybl; Wed, 8 Jan 2020 09:39:45 -0800 (PST) X-Google-Smtp-Source: APXvYqwecOxvwP8gaGzMkF+I8pbGbwO+WfdyH5T+FwqzNLIg8NYpQOi/D4ix0uxapD8Rr+mFyiZh X-Received: by 2002:aca:4b14:: with SMTP id y20mr3865929oia.160.1578505185094; Wed, 08 Jan 2020 09:39:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578505185; cv=none; d=google.com; s=arc-20160816; b=BxXyyt3U58sVmYuPvyD2FYwTv9RwlsHXO4V1Zq15D70DCVLeNaGdsX2P5pikGJmO67 qgCX8n2lfJyg1fx3Dw9LXLvVSQgM03nqepFFwIeIIu/AARNnC/WTivlKqlvUGeEh5BH0 EnKbueyYHpizW0mgQg0nIjCpVD9umGxqtZXKcx8SE3RXfZE7QQwrL5M15ijOXmPPYjmG C4kj4997LV9Sw6HeWgbOekBH6/OAZ73LI3iN6x4+cPDPNGxOakPKJup8o27nV9mxG13f e/KmL2mR2Kx5yf3uEgeM0Md5nTLkxaBs8jshHmJEJWvdGpUxBfmak8Ha1BLXlKcqE7K8 cTrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=E3QI8mJw0rw5tBcbGfufjkmlvYjjxUvHg736D9FadWY=; b=QlKLb3DbPyt0osVXNvH56vmZuLCX8NMhvCb/3d476bdsr/srJo5Np+08THuAdU4NFE 715dOXkosTc7XTddOq9lsf2byb5O5RlinfbosldwSdW5CjYIx7xpv18yG2EvI88ogruc abz9Zx97HavBt8EJLc3KNm3F0QRQV2C7Psg7fRv11Npmz+ZUopchy5qPRuHOJ4s/RIXl acNpWQT42cKRD64rFwUXmioYnF/zHnCzewJ/2Y/X8SZGZ9p2NXg/QyHMDidiAtDeoUf0 HcymvIxNF2oJeYWDMZ7nCpYLG91gfRqmQojXS3XMIOmA+POaBt/CyDt2ybwle8CWzIyD Tl6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n14si2223289otk.179.2020.01.08.09.39.33; Wed, 08 Jan 2020 09:39:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728604AbgAHPGP (ORCPT + 99 others); Wed, 8 Jan 2020 10:06:15 -0500 Received: from verein.lst.de ([213.95.11.211]:49700 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726281AbgAHPGP (ORCPT ); Wed, 8 Jan 2020 10:06:15 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 96E1868BFE; Wed, 8 Jan 2020 16:06:12 +0100 (CET) Date: Wed, 8 Jan 2020 16:06:12 +0100 From: Christoph Hellwig To: "Martin K. Petersen" Cc: Balbir Singh , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, axboe@kernel.dk, ssomesh@amazon.com, jejb@linux.ibm.com, hch@lst.de, mst@redhat.com, Chaitanya.Kulkarni@wdc.com Subject: Re: [resend v1 5/5] drivers/scsi/sd.c: Convert to use disk_set_capacity Message-ID: <20200108150612.GD10975@lst.de> References: <20200102075315.22652-1-sblbir@amazon.com> <20200102075315.22652-6-sblbir@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 06, 2020 at 10:48:30PM -0500, Martin K. Petersen wrote: > > Balbir, > > > diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c > > index 5afb0046b12a..1a3be30b6b78 100644 > > --- a/drivers/scsi/sd.c > > +++ b/drivers/scsi/sd.c > > @@ -3184,7 +3184,7 @@ static int sd_revalidate_disk(struct gendisk *disk) > > > > sdkp->first_scan = 0; > > > > - set_capacity(disk, logical_to_sectors(sdp, sdkp->capacity)); > > + disk_set_capacity(disk, logical_to_sectors(sdp, sdkp->capacity)); > > sd_config_write_same(sdkp); > > kfree(buffer); > > We already emit an SDEV_EVT_CAPACITY_CHANGE_REPORTED event if device > capacity changes. However, this event does not automatically cause > revalidation. Who is looking at these sdev specific events? (And who is looking at the virtio/xenblk ones?) It makes a lot of sense to have one event supported by all devices. But don't ask me which one would be the best..