Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp22165582ybl; Mon, 6 Jan 2020 19:59:07 -0800 (PST) X-Google-Smtp-Source: APXvYqzEFuX8VmPGNTzNRQxJCo3XuQ4eO43wIQdv1uEYMt9eHPa32fJU+mb7kilQmdElknrZB9IK X-Received: by 2002:a9d:784b:: with SMTP id c11mr113045271otm.246.1578369547607; Mon, 06 Jan 2020 19:59:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578369547; cv=none; d=google.com; s=arc-20160816; b=QyB3M2rcNwH0/1DGcZ0Uz1Cs7fUjr9eCSiasLU7f6N9atN4c08CPAkJTrwxmlfd3W+ hm/Moj7yB8IpL3zj74Qf78eYA1dlbDlS4iZcyyMRtSJjPV1d18p6p1FVYGp0hZqvoZRw MqsSzYBv8HFVmJqLLcMiNWchtwDZnnOu27MzxUKtIsoRqZiwoVPPtLDo+bniArzuRs2c LfqLEy/ud7GiMY30JpgfRCj0chn1jYkW2dyzHqCM9xqjx1KMiVEmk1u8lhhn8Ju/lH5j GPJJmmo9u8ZM273XwTP2xIvh5Y+ttOtdCStfcr/DW7x8Rj3YTNbeg/5/9IpxiHDrIuaZ 3C9g== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=c5G4t36IKJQIvJWXZwYzRS1BE+m4t7HtnweYuU1K4Nc=; b=PakIWSCNG8KJsrI4/98y8mNGJ0WLXpHewSeq+ELMOdN7R3iDIp0rRCRnyfeZe3k1wb 7sgebLj96Y8TG2woZYGHXNFi4IvWLxJsRc0coEdAKTr2WvC8P56G+oF2chn6yXnUXgrW s7gP5vOu0V8lWdy7qdw6+VxpElHNXgLwdWqztt8AIFHxRxx6PdG5hdjD+fLsxn/eW1kB ssYP1yWrLuzbbIXzi1U5NwI4gMQ8G+cdbt0j862iMlZSmPnNExRD0vcNaWmJ2OtaPhOZ ZQ/KkocO2goQgigeWjcY5GUX1t2H9cC1S3EEquQqMT9lOdkNLmfKYI02hrwkShS63+ra Cf1Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m4si34647297otr.122.2020.01.06.19.58.55; Mon, 06 Jan 2020 19:59:07 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727497AbgAGD6N (ORCPT + 99 others); Mon, 6 Jan 2020 22:58:13 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:14274 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727452AbgAGD6N (ORCPT ); Mon, 6 Jan 2020 22:58:13 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0073vLiG040204; Mon, 6 Jan 2020 22:58:03 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2xb8um7r5q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Jan 2020 22:58:03 -0500 Received: from m0098394.ppops.net (m0098394.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0073w2mo043338; Mon, 6 Jan 2020 22:58:02 -0500 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 2xb8um7r5g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Jan 2020 22:58:02 -0500 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 0073vJ5E004441; Tue, 7 Jan 2020 03:58:01 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma04dal.us.ibm.com with ESMTP id 2xajb6dtf0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Jan 2020 03:58:01 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0073w1R714418312 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 Jan 2020 03:58:01 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2153AAE05C; Tue, 7 Jan 2020 03:58:01 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D2BECAE062; Tue, 7 Jan 2020 03:57:59 +0000 (GMT) Received: from jarvis.ext.hansenpartnership.com (unknown [9.85.172.186]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 7 Jan 2020 03:57:59 +0000 (GMT) Message-ID: <1578369479.3251.31.camel@linux.ibm.com> Subject: Re: [resend v1 5/5] drivers/scsi/sd.c: Convert to use disk_set_capacity From: James Bottomley To: "Martin K. Petersen" , Balbir Singh Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, axboe@kernel.dk, ssomesh@amazon.com, hch@lst.de, mst@redhat.com, Chaitanya.Kulkarni@wdc.com Date: Mon, 06 Jan 2020 19:57:59 -0800 In-Reply-To: References: <20200102075315.22652-1-sblbir@amazon.com> <20200102075315.22652-6-sblbir@amazon.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2020-01-06_08:2020-01-06,2020-01-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 impostorscore=0 suspectscore=0 adultscore=0 phishscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxlogscore=733 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-2001070030 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-01-06 at 22:48 -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. Which I seem to remember was a deliberate choice: some change capacities occur because the path goes passive and default values get installed. James