From patchwork Tue Jul 19 13:25:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 9237363 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D6DC5602F0 for ; Tue, 19 Jul 2016 13:25:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7DD826B4A for ; Tue, 19 Jul 2016 13:25:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BCB5426E64; Tue, 19 Jul 2016 13:25:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FAAE26D19 for ; Tue, 19 Jul 2016 13:25:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753793AbcGSNZR (ORCPT ); Tue, 19 Jul 2016 09:25:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:60560 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753775AbcGSNZO (ORCPT ); Tue, 19 Jul 2016 09:25:14 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 13520ADBA; Tue, 19 Jul 2016 13:25:13 +0000 (UTC) From: Hannes Reinecke To: "Martin K. Petersen" Cc: James Bottomley , linux-scsi@vger.kernel.org, Christoph Hellwig , Damien Le Moal Subject: [PATCH 4/5] sd: Limit messages for ZBC disks capacity change Date: Tue, 19 Jul 2016 15:25:09 +0200 Message-Id: <1468934710-93876-5-git-send-email-hare@suse.de> X-Mailer: git-send-email 1.8.5.6 In-Reply-To: <1468934710-93876-1-git-send-email-hare@suse.de> References: <1468934710-93876-1-git-send-email-hare@suse.de> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Damien Le Moal For ZBC disks with RC_BASIS=0, limit the message indicating the capacity adjustment to the disk first scan. Signed-off-by: Damien Le Moal --- 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 f7b6132..3a9d96e 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2128,9 +2128,10 @@ static void sd_read_zones(struct scsi_disk *sdkp, unsigned char *buffer) /* The max_lba field is the capacity of a zoned device */ lba = get_unaligned_be64(&buffer[8]); if (lba + 1 > sdkp->capacity) { - sd_printk(KERN_WARNING, sdkp, - "Max LBA %zu (capacity %zu)\n", - (sector_t) lba + 1, sdkp->capacity); + if (sdkp->first_scan) + sd_printk(KERN_WARNING, sdkp, + "Changing capacity from %zu to Max LBA+1 %zu\n", + sdkp->capacity, (sector_t) lba + 1); sdkp->capacity = lba + 1; } }