Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp396864imm; Thu, 31 May 2018 02:26:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLzZJEPhXR9732Fuw/jxdW4TyC/RCIuHBggFwc4zzJwQkg0PHAuqDl8THRLFnPML0hwjOgi X-Received: by 2002:a17:902:1081:: with SMTP id c1-v6mr6209721pla.153.1527758811470; Thu, 31 May 2018 02:26:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527758811; cv=none; d=google.com; s=arc-20160816; b=dpZtBzRwEZhtBlrxhr4M/mbVhpv9vnPFnFGTFX5InKZLrIbFGBYL3eSc8JlBIUVqaQ Dx0+/VZkql3XaykaJiLBGLAZmdDMrJzOeC1dTGUdlJGmqS/StC+BEPQpCkN9yRStPMYz XDGinmRKZQaqSjB4hgYF7a8Xi1wtRb5BVa36aC0r2/hQkRj7kCLhzSLQH02XpbWpnDfN 6a2/O3ePegVGMZOybd4JY1p2swukyglDwltZaEOPR3sp0ONtRcepk0iIoLeL67wi8SKB Fnq16IhW3aOE4we4zbSrNXYtaRxhyj8eA29U762r6DY6ehi06NyBtz/kbdwt0H0wjzQy PEPQ== 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=6xQMlsZX1n7VU8SsS5cN/1O9NsM2ntggQEb0/rX2Z68=; b=ClKHzdkCUa8nHKhBhjLO/y7Gkv+xUeotqNl2lRMGCYQg2TdKTfV4ta1Ag2AY8MkIEV nL/Rvrhe6iuGAQhTcbI7hI7GO7fCVn4K6z90o1CBC8e3128PvdLPIsyD20z68f/ONJOH y3lDweW9pwPL8zWJjoe33O6wofTfpxAoioyRrFnfZJGx0+nj0il2J5TbjEY4gJjmvRK/ xS763ye06XP3KEs2OYl6XyjLMnx+2HXT2Me92KopLm4CSs7w2iq7FiuMMzoZkpEmbdv1 DiZNIIoKFqNiNqoZZTHnr6jN0Pp9A5welzaDCcByx3n3mgcyDMGtDhrlPGO0EvpHeuVH YfiQ== 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 1-v6si36431895ply.226.2018.05.31.02.26.37; Thu, 31 May 2018 02:26:51 -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 S1754222AbeEaJY6 (ORCPT + 99 others); Thu, 31 May 2018 05:24:58 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:54577 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754092AbeEaJYz (ORCPT ); Thu, 31 May 2018 05:24:55 -0400 Received: by mail-wm0-f65.google.com with SMTP id f6-v6so52721406wmc.4 for ; Thu, 31 May 2018 02:24:54 -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=6xQMlsZX1n7VU8SsS5cN/1O9NsM2ntggQEb0/rX2Z68=; b=bQQxTI59RDBWKICu2BL//jgvIjIlxSR/+M1KUePamXXMGZsu5vrzp2/FqAqScAcwLo lOVzHXYdrOqR5t5VkpTrvFHfExQ8w0ltWD6c2579o36EzSNPSwtv2RkjwcXSUVkKl2QL f2RvWEvTV/ZFolFEp/bXvGPEyU7ee6uFDGcx0Mtv6zpzoDcZ2RKVQIJL+t8p+GNh5OK8 H1agPTjvhQgqmoOiRxoym9Eb+lU9Yj0EqSmbaXlg4jN8WajLQR4HKRZTwFKfVGgwbvTd IQ7c4qF9urSVGK6BUSLosEvH73YYSvCeGEcFjpxGMI3yvEVdrR/KXU3vwSdDtRWO4Duy +naQ== X-Gm-Message-State: ALKqPwcsyY++HT/LFXFlExzdcOoJG6tnZWWuF9ZKyEtbqsIZPoZYX/EI Z3ZdKGSuXjX6KpHgnFXdDEc= X-Received: by 2002:a1c:4ad9:: with SMTP id n86-v6mr4243987wmi.0.1527758694371; Thu, 31 May 2018 02:24:54 -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 76-v6sm2119950wmj.0.2018.05.31.02.24.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 May 2018 02:24:53 -0700 (PDT) Subject: Re: [PATCH 2/5] nvme: don't hold nvmf_transports_rwsem for more than transport lookups To: Christoph Hellwig , Johannes Thumshirn Cc: Keith Busch , Linux NVMe Mailinglist , Linux Kernel Mailinglist , Hannes Reinecke References: <20180515074043.22843-1-jthumshirn@suse.de> <20180515074043.22843-3-jthumshirn@suse.de> <20180515074826.GA23659@lst.de> From: Sagi Grimberg Message-ID: <8577e467-ad74-d9bd-8f49-3ace18fc1126@grimberg.me> Date: Thu, 31 May 2018 12:24:51 +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: <20180515074826.GA23659@lst.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 >> diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c >> index 7ae732a77fe8..febf82639b40 100644 >> --- a/drivers/nvme/host/fabrics.c >> +++ b/drivers/nvme/host/fabrics.c >> @@ -957,16 +957,17 @@ nvmf_create_ctrl(struct device *dev, const char *buf, size_t count) >> >> down_read(&nvmf_transports_rwsem); >> ops = nvmf_lookup_transport(opts); >> + up_read(&nvmf_transports_rwsem); > > And what protects us from the transport getting unregister right here > from anothet thread waiting to acquire nvmf_transports_rwsem? I think having the module_get inside as well would protect against it.