From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751496AbcETW6W (ORCPT ); Fri, 20 May 2016 18:58:22 -0400 Received: from mga02.intel.com ([134.134.136.20]:57733 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751103AbcETW6V (ORCPT ); Fri, 20 May 2016 18:58:21 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,341,1459839600"; d="scan'208";a="959187275" Date: Fri, 20 May 2016 19:05:28 -0400 From: Keith Busch To: Alexey Khoroshilov Cc: Jens Axboe , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: Re: [PATCH] NVMe: fix deadlock on failure branch in nvme_get_ns_from_disk() Message-ID: <20160520230527.GA2839@localhost.localdomain> References: <1463783760-5851-1-git-send-email-khoroshilov@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1463783760-5851-1-git-send-email-khoroshilov@ispras.ru> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 21, 2016 at 01:36:00AM +0300, Alexey Khoroshilov wrote: > kref_put(&ns->kref, nvme_free_ns) is called in nvme_get_ns_from_disk() > under dev_list_lock spinlock, while nvme_free_ns() locks the spinlock > by itself. This can lead to a deadlock. > > The patch moves try_module_get() and its error handling > out of spinlock section. This is also fixed with this earlier posted patch: http://lists.infradead.org/pipermail/linux-nvme/2016-May/004530.html