Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3452453ybi; Mon, 29 Jul 2019 06:51:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxea9Vc5Ch3CHYTWfEZWNIR3I4VGSU9CsO+YEn2j8scSICwDhGzxX0ISZlaVoYOZo6tBqT9 X-Received: by 2002:a17:90a:b903:: with SMTP id p3mr110440156pjr.79.1564408282268; Mon, 29 Jul 2019 06:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564408282; cv=none; d=google.com; s=arc-20160816; b=C1zeDzTjxyVzV/nrvHb9eujtn7vNAEdEGgUTAhVwJadvHbTMVWK92xF+/FEdie4y2F MNt1py+TI3uh3NxpI0O8/ZbijE4jesnYG/39tsMqsRkXH6OJyZCw/NOgA3IrPver6l0f 4fpV0GOaNBa32HenZF3NlobmgDwGlhCoRaTkSW3of09HfZ1XSj0hPqyBZV0j0hv7XxTj JkB7c4nZQ5yFUs/+FUr8HZHuMl6glR49rPk5WsjIfV7Clg/IpK5jz/Ay8qZojxm/yzMt qMDnIshOQ5TPPUMpeMB+CmAJxTDmeBMt3NEANGYbvtdJOTPKdTTVqRjHRR+6WiPOqFvY 0N6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=sBtxoVrpLpWIIwLpblcfPhwLYPeCiGohMgOhjzI3pDk=; b=SSio94iPTa9R68EUghXGsWJbnL5JifCriV+zWvPy7FRlEdaglYAqIIqvhLobA0pro6 hG1lwHf/wR8+0gf8GyKwXIA9IOa8oW3an+Kc+oGzG+l169GISoD9A6OAlLg2mK2p4kXN TJvaXdYGgTccrVu/Db8ICGpHdamkHoSyUU7Ywz2LKWYunPLzDLUjGYNTSaDfqSHQ2MgG FVPGRcB4g3RVTsJauYjCEz1C3HUcNwjnF+EHBTHmuejHvAEJtnQxop2VsJMnvdlGrgeO xP7LvOHEckYSeTHkAI+HFYPqeyd7viJ94hSXa3m0cVEegZkW6ZoCkLtypUcgR5FTN28W HzBg== 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 d8si30122913pfr.182.2019.07.29.06.51.07; Mon, 29 Jul 2019 06:51:22 -0700 (PDT) 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 S2387903AbfG2Ml1 (ORCPT + 99 others); Mon, 29 Jul 2019 08:41:27 -0400 Received: from mx2.suse.de ([195.135.220.15]:60298 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726986AbfG2Ml1 (ORCPT ); Mon, 29 Jul 2019 08:41:27 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D7383ADCB; Mon, 29 Jul 2019 12:41:25 +0000 (UTC) From: Anthony Iliopoulos To: Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg Cc: Johannes Thumshirn , Anthony Iliopoulos , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] nvme/multipath: revalidate nvme_ns_head gendisk in nvme_validate_ns Date: Mon, 29 Jul 2019 14:40:40 +0200 Message-Id: <20190729124040.16581-1-ailiopoulos@suse.com> X-Mailer: git-send-email 2.16.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_NVME_MULTIPATH is set, only the hidden gendisk associated with the per-controller ns is run through revalidate_disk when a rescan is triggered, while the visible blockdev never gets its size (bdev->bd_inode->i_size) updated to reflect any capacity changes that may have occurred. This prevents online resizing of nvme block devices and in extension of any filesystems atop that will are unable to expand while mounted, as userspace relies on the blockdev size for obtaining the disk capacity (via BLKGETSIZE/64 ioctls). Fix this by explicitly revalidating the actual namespace gendisk in addition to the per-controller gendisk, when multipath is enabled. Signed-off-by: Anthony Iliopoulos --- drivers/nvme/host/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 8f3fbe5ca937..80c7a7ee240b 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1715,6 +1715,7 @@ static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id) if (ns->head->disk) { nvme_update_disk_info(ns->head->disk, ns, id); blk_queue_stack_limits(ns->head->disk->queue, ns->queue); + revalidate_disk(ns->head->disk); } #endif } -- 2.16.4