Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp349392imm; Thu, 31 May 2018 01:18:46 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJsYsqUhwQE/kvte8PlIx4SdPhtka8nmYG4KFYMKWzeUJfp5BR6xCy9kWwoPwVWZarCh4kV X-Received: by 2002:a17:902:a512:: with SMTP id s18-v6mr6003432plq.223.1527754726627; Thu, 31 May 2018 01:18:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527754726; cv=none; d=google.com; s=arc-20160816; b=P4BJbERtxZzL7fNxO0qUgd81koj53r93o34x5WaSDFCBdMSLPZspO8ZTBFDchYR8OO 3bc18+ToK44E/RuJo9RBc0rrNQ36TqP0OPDaIUUetnTfgVUEozcbDXAMET8gGsMbm1Lw hEJuSYsHpoC6a7Xa6hrrctt30Sy70as3JGfUsE1WmAWo9SFLNI1uOxzyfOtOYSE2GNTR 4Ow86XVa7Hf6jaexzmvxi68nxUULt3+UgSYX+ntgXFhKQmB+sCQ3Py+l5OEN1Fwv21HJ vFBKnI42bPAkWSHqJIs33oX2JF3xuU1dCng1MNeQ6S/zQp0qky1LuPPb5ANaX60vEi1A Rrnw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=nCGv/jDs0Wewa/ab3dsW8C6PAU6PhGRN4Fg7rtzTHVU=; b=KIdKpKz+CRSxCpY3vDzD0e667Vxp379tniW37zR/dFy5VY6iFhOwk1FDoyEzZtbSZg VGqnDoZXjaE4gyhHtHQWyVh92ANrpHByi/+rYV86SWHClXPKfZ+vo98MNCCsmcfTuo04 cHvzJmFMoHtQiOWCk0Ec7rCEai/nPMP/hStSMAaZ4WdPlI3XLkUxfIW8eJIzYrzc7xps T2w7R2fgP+3Xj6Q1ZcHsV83p1NXlRBR3/n3C4Za0scnDyRDfWjEL0dVIUbYv+6u+q/IH e4aDb2CM1wVD++Yy31+pgA6rsYD91Ww0Ha4QbmUpeh7vJsRgQ5gIXqI6Xr9Olv8fIXjS ZZew== 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 x1-v6si35160264pfm.32.2018.05.31.01.18.32; Thu, 31 May 2018 01:18:46 -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 S1754058AbeEaIR7 (ORCPT + 99 others); Thu, 31 May 2018 04:17:59 -0400 Received: from mail-wr0-f178.google.com ([209.85.128.178]:33438 "EHLO mail-wr0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753957AbeEaIR4 (ORCPT ); Thu, 31 May 2018 04:17:56 -0400 Received: by mail-wr0-f178.google.com with SMTP id k16-v6so4811694wro.0 for ; Thu, 31 May 2018 01:17:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=nCGv/jDs0Wewa/ab3dsW8C6PAU6PhGRN4Fg7rtzTHVU=; b=GiF8lmMv00zU4jESDca9OKJJXVBkGNf15qkd4GmWMYXjdg2c6O3kfgjCodoX9ZTxmu dZO9nLR/IM83YfiGz66gr3+6ygwi0UEV8s3A0NqDvtufKxh21CJfcTAmMt3QPbHPkE4b 65AoOaeUQhEvhPMGctmhSHRz/NRXEzIM0vtGhHulZSLGKzx2NNs432cos/krIirem3QI c9MQdte4f71i8fTRs3v+K0BctEgaGOEUjNAjfUi7bFPGivxvQ4M8U+A9kmllTTUrMVdh ZDK46BmfwFfputN0Ia/BgPPiO8mtlwEI1wUsVChUipxGAUvaT/TgO77MhentG11rIJCV MugA== X-Gm-Message-State: ALKqPwdRv0CPoeFclNWg4Ya87TGKsxjW+0IgaAEu2W2hAY54MDrBxUsz uJvOVGN6T+26MM8nOrwDv2Q= X-Received: by 2002:adf:b8ce:: with SMTP id c14-v6mr4577097wrg.122.1527754675122; Thu, 31 May 2018 01:17:55 -0700 (PDT) Received: from [192.168.64.169] (bzq-219-42-90.isdn.bezeqint.net. [62.219.42.90]) by smtp.gmail.com with ESMTPSA id o53-v6sm59225781wrc.96.2018.05.31.01.17.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 May 2018 01:17:54 -0700 (PDT) Subject: Re: [PATCH 1/3] nvme: provide a way to disable nvme mpath per subsystem To: Johannes Thumshirn , Christoph Hellwig , Keith Busch Cc: Hannes Reinecke , Mike Snitzer , Laurence Oberman , Ewan Milne , James Smart , Linux Kernel Mailinglist , Linux NVMe Mailinglist , "Martin K . Petersen" , Martin George , John Meneghini References: <20180525125322.15398-1-jthumshirn@suse.de> <20180525125322.15398-2-jthumshirn@suse.de> From: Sagi Grimberg Message-ID: <795f42a6-a6c3-e42d-3215-71b36fb7a0d4@grimberg.me> Date: Thu, 31 May 2018 11:17:52 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180525125322.15398-2-jthumshirn@suse.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @@ -246,3 +246,27 @@ void nvme_mpath_remove_disk(struct nvme_ns_head *head) > blk_cleanup_queue(head->disk->queue); > put_disk(head->disk); > } > + > +int nvme_mpath_change_personality(struct nvme_subsystem *subsys) > +{ > + struct nvme_ctrl *ctrl; > + int ret = 0; > + > +restart: > + mutex_lock(&subsys->lock); > + list_for_each_entry(ctrl, &subsys->ctrls, subsys_entry) { > + if (!list_empty(&ctrl->namespaces)) { > + mutex_unlock(&subsys->lock); > + nvme_remove_namespaces(ctrl); This looks completely broken. Any of these namespaces can have an active handle on it.