From patchwork Wed Oct 14 02:28:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 7389751 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 079489F302 for ; Wed, 14 Oct 2015 02:34:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4656420636 for ; Wed, 14 Oct 2015 02:34:26 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8320220621 for ; Wed, 14 Oct 2015 02:34:25 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 789D361713; Tue, 13 Oct 2015 19:34:25 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by ml01.01.org (Postfix) with ESMTP id D562D616F1 for ; Tue, 13 Oct 2015 19:34:23 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 13 Oct 2015 19:34:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,681,1437462000"; d="scan'208";a="792130814" Received: from dwillia2-desk3.jf.intel.com ([10.54.39.39]) by orsmga001.jf.intel.com with ESMTP; 13 Oct 2015 19:34:23 -0700 Subject: [PATCH 08/11] nvme: suspend i/o during runtime blk_integrity_unregister From: Dan Williams To: martin.petersen@oracle.com Date: Tue, 13 Oct 2015 22:28:41 -0400 Message-ID: <20151014022841.34443.28017.stgit@dwillia2-desk3.jf.intel.com> In-Reply-To: <20151014022757.34443.25800.stgit@dwillia2-desk3.jf.intel.com> References: <20151014022757.34443.25800.stgit@dwillia2-desk3.jf.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 Cc: Keith Busch , linux-nvdimm@lists.01.org, axboe@fb.com, linux-nvme@vger.kernel.org, hch@lst.de X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Synchronize pending i/o against a change in the integrity profile to avoid the possibility of spurious integrity errors. Cc: Keith Busch Cc: Matthew Wilcox Signed-off-by: Dan Williams --- drivers/nvme/host/pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 65190e51aa47..7e6577f6ace6 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2036,8 +2036,11 @@ static int nvme_revalidate_disk(struct gendisk *disk) if (blk_get_integrity(disk) && (ns->pi_type != pi_type || ns->ms != old_ms || bs != queue_logical_block_size(disk->queue) || - (ns->ms && ns->ext))) + (ns->ms && ns->ext))) { + blk_mq_freeze_queue(disk->queue); blk_integrity_unregister(disk); + blk_mq_unfreeze_queue(disk->queue); + } ns->pi_type = pi_type; blk_queue_logical_block_size(ns->queue, bs);