]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
autofs4 - fix lockdep splat in autofs
authorSteven Rostedt <rostedt@goodmis.org>
Mon, 22 Aug 2011 03:52:28 +0000 (11:52 +0800)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 14 Feb 2012 01:45:37 +0000 (20:45 -0500)
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 <rostedt@goodmis.org>
Acked-by: Ian Kent <raven@themaw.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/autofs4/expire.c

index 450f529a4eaeb6e6d48bd147548a2ad3fb72f961..1feb68ecef9509dd88a4323f3193845af6a84e15 100644 (file)
@@ -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;
        }