From patchwork Thu Oct 15 20:00:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 7409501 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D3D79BF90C for ; Thu, 15 Oct 2015 20:12:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1B21720653 for ; Thu, 15 Oct 2015 20:12:02 +0000 (UTC) Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 324CA2060B for ; Thu, 15 Oct 2015 20:12:01 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id t9FK8sIZ014513; Thu, 15 Oct 2015 16:08:54 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id t9FK6XQm002186 for ; Thu, 15 Oct 2015 16:06:33 -0400 Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9FK6XKY007862 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 15 Oct 2015 16:06:33 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx1.redhat.com (Postfix) with ESMTP id 801FE31411D for ; Thu, 15 Oct 2015 20:06:32 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 15 Oct 2015 13:06:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,687,1437462000"; d="scan'208";a="812011793" Received: from dwillia2-desk3.jf.intel.com ([10.54.39.39]) by fmsmga001.fm.intel.com with ESMTP; 15 Oct 2015 13:06:06 -0700 From: Dan Williams To: martin.petersen@oracle.com Date: Thu, 15 Oct 2015 16:00:23 -0400 Message-ID: <20151015200023.20721.84329.stgit@dwillia2-desk3.jf.intel.com> In-Reply-To: <20151015195939.20721.23101.stgit@dwillia2-desk3.jf.intel.com> References: <20151015195939.20721.23101.stgit@dwillia2-desk3.jf.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 X-RedHat-Spam-Score: -4.63 (BAYES_50, DCC_REPUT_00_12, RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_PASS, T_RP_MATCHES_RCVD, URIBL_BLOCKED) 134.134.136.65 mga03.intel.com 134.134.136.65 mga03.intel.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Scanned-By: MIMEDefang 2.75 on 10.5.110.26 X-loop: dm-devel@redhat.com Cc: linux-raid@vger.kernel.org, linux-nvdimm@ml01.01.org, linux-nvme@lists.infradead.org, axboe@fb.com, dm-devel@redhat.com, Matthew Wilcox , Keith Busch , hch@lst.de Subject: [dm-devel] [PATCH v2 08/12] nvme: suspend i/o during runtime blk_integrity_unregister X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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: Matthew Wilcox Acked-by: Keith Busch [keith: also protect dynamic integrity registration] Signed-off-by: Dan Williams --- drivers/nvme/host/pci.c | 2 ++ 1 file changed, 2 insertions(+) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 65190e51aa47..5578de67f406 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2033,6 +2033,7 @@ static int nvme_revalidate_disk(struct gendisk *disk) pi_type = ns->ms == sizeof(struct t10_pi_tuple) ? id->dps & NVME_NS_DPS_PI_MASK : 0; + blk_mq_freeze_queue(disk->queue); if (blk_get_integrity(disk) && (ns->pi_type != pi_type || ns->ms != old_ms || bs != queue_logical_block_size(disk->queue) || @@ -2052,6 +2053,7 @@ static int nvme_revalidate_disk(struct gendisk *disk) if (dev->oncs & NVME_CTRL_ONCS_DSM) nvme_config_discard(ns); + blk_mq_unfreeze_queue(disk->queue); kfree(id); return 0;