Path: news.gmane.org!not-for-mail From: Ian Kent Newsgroups: gmane.linux.kernel Subject: [PATCH] autofs4 - fix lockdep splat in autofs Date: Mon, 22 Aug 2011 11:52:28 +0800 Lines: 35 Approved: news@gmane.org Message-ID: <20110822035228.13189.62994.stgit@perseus.themaw.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1313985730 20409 80.91.229.12 (22 Aug 2011 04:02:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 22 Aug 2011 04:02:10 +0000 (UTC) Cc: Kernel Mailing List , Steven Rostedt To: Al Viro Original-X-From: linux-kernel-owner@vger.kernel.org Mon Aug 22 06:02:05 2011 Return-path: Envelope-to: glk-linux-kernel-3@lo.gmane.org Original-Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QvLi6-00059I-P9 for glk-linux-kernel-3@lo.gmane.org; Mon, 22 Aug 2011 06:02:03 +0200 Original-Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750951Ab1HVEBw (ORCPT ); Mon, 22 Aug 2011 00:01:52 -0400 Original-Received: from outbound.icp-qv1-irony-out2.iinet.net.au ([203.59.1.107]:23283 "EHLO outbound.icp-qv1-irony-out2.iinet.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750806Ab1HVEBu (ORCPT ); Mon, 22 Aug 2011 00:01:50 -0400 X-Greylist: delayed 554 seconds by postgrey-1.27 at vger.kernel.org; Mon, 22 Aug 2011 00:01:50 EDT X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EADDSUU7LO5kB/2dsb2JhbABBhEujSHeBQAEpBFIoCAUCGA4CSRYTrRSQOYEshAyBEASHXpBgi1k X-IronPort-AV: E=Sophos;i="4.68,261,1312128000"; d="scan'208";a="765105065" Original-Received: from unknown (HELO perseus.themaw.net) ([203.59.153.1]) by outbound.icp-qv1-irony-out2.iinet.net.au with ESMTP; 22 Aug 2011 11:52:32 +0800 User-Agent: StGIT/0.14.3 Original-Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Xref: news.gmane.org gmane.linux.kernel:1182197 Archived-At: From: Steven Rostedt When recursing down the locks when traversing a tree/list in get_next_positive_dentry() or get_next_positive_subdir() a lock can change from being nested to being a parent which breaks lockdep. This patch tells lockdep about what we did. Signed-off-by: Steven Rostedt Acked-by: Ian Kent --- fs/autofs4/expire.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c index 450f529..1feb68e 100644 --- a/fs/autofs4/expire.c +++ b/fs/autofs4/expire.c @@ -124,6 +124,7 @@ start: /* Negative dentry - try next */ if (!simple_positive(q)) { spin_unlock(&p->d_lock); + lock_set_subclass(&q->d_lock.dep_map, 0, _RET_IP_); p = q; goto again; } @@ -186,6 +187,7 @@ again: /* Negative dentry - try next */ if (!simple_positive(ret)) { spin_unlock(&p->d_lock); + lock_set_subclass(&ret->d_lock.dep_map, 0, _RET_IP_); p = ret; goto again; }