Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751525Ab3HSLXG (ORCPT ); Mon, 19 Aug 2013 07:23:06 -0400 Received: from s3.sipsolutions.net ([144.76.43.152]:50876 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751321Ab3HSLXD (ORCPT ); Mon, 19 Aug 2013 07:23:03 -0400 Message-ID: <1376911362.14734.11.camel@jlt4.sipsolutions.net> Subject: Re: 3.11-rc6 genetlink locking fix offends lockdep From: Johannes Berg To: Ding Tianhong Cc: Hugh Dickins , Linus Torvalds , Greg KH , "David S. Miller" , "Otcheretianski, Andrei" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "stable@vger.kernel.org" , Pravin B Shelar , Thomas Graf Date: Mon, 19 Aug 2013 13:22:42 +0200 In-Reply-To: <5211FAB3.7080400@huawei.com> References: <1376899214.14734.6.camel@jlt4.sipsolutions.net> <5211FAB3.7080400@huawei.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.6.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1240 Lines: 35 On Mon, 2013-08-19 at 19:00 +0800, Ding Tianhong wrote: > On 2013/8/19 16:00, Johannes Berg wrote: > > > >> 3.11-rc6's commit 58ad436fcf49 ("genetlink: fix family dump race") > >> gives me the lockdep trace below at startup. > > > > Hmm. Yes, I see now how this happens, not sure why I didn't run into it. > > > > The problem is that genl_family_rcv_msg() is called with the genl_lock > > held, and then calls netlink_dump_start() with it held, creating a > > genl_lock->cb_mutex dependency, but obviously the dump continuation is > > the other way around. > > > > We could use the semaphore instead, I believe, but I don't really > > understand the mutex vs. semaphore well enough to be sure that's > > correct. > > > > johannes > > > it is useless, the logic need to modify or otherwise it will still call lockdep trace. I don't believe so, the semaphore and cb_mutex don't have a dependency yet, afaict. > maybe i could send a patch for it, if you wish. What do you mean? johannes -- 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/