Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752878AbaDDVPf (ORCPT ); Fri, 4 Apr 2014 17:15:35 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:16640 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752837AbaDDVPd (ORCPT ); Fri, 4 Apr 2014 17:15:33 -0400 Message-ID: <533F20EB.2040500@oracle.com> Date: Fri, 04 Apr 2014 17:15:23 -0400 From: Sasha Levin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Jeff Mahoney , dsterba@suse.cz, clm@fb.com, jbacik@fb.com, linux-btrfs@vger.kernel.org, LKML Subject: Re: btrfs: lock inversion between delayed_node->mutex and found->groups_sem References: <53239AE0.8030306@oracle.com> <20140317130546.GE29256@twin.jikos.cz> <533307ED.8030700@suse.com> In-Reply-To: <533307ED.8030700@suse.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/26/2014 01:01 PM, Jeff Mahoney wrote: > On 3/17/14, 9:05 AM, David Sterba wrote: >>> On Fri, Mar 14, 2014 at 08:12:16PM -0400, Sasha Levin wrote: >>>>> While fuzzing with trinity inside a KVM tools guest running the latest -next kernel I've stumbled on the following: >>>>> >>>>> [ 788.458756] CPU0 CPU1 [ 788.459188] ---- ---- [ 788.459625] lock(&found->groups_sem); [ 788.460041] local_irq_disable(); [ 788.460041] lock(&delayed_node->mutex); [ 788.460041] lock(&found->groups_sem); [ 788.460041] [ 788.460041] lock(&delayed_node->mutex); [ 788.460041] [ 788.460041] *** DEADLOCK *** [ 788.460041] [ 788.460041] 2 locks held by kswapd3/4199: >>> >>> I've once (3.14-rc5) seen the same warning also caused by xfstests/generic/224 > I think this is from my sysfs patches. We call kobject_add while holding the group_sem. kobject_add ultimately allocates with GFP_KERNEL, so it can enter reclaim. This particular case isn't dangerous, but it could hit while hot-adding a device. The fix should be pretty simple. Is that fix available anywhere? I'm still seeing the issue in -next. Thanks, Sasha -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/