Skip to content

Commit

Permalink
autofs4 - fix lockdep splat in autofs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Rostedt authored and Al Viro committed Feb 14, 2012
1 parent e188dc0 commit 1d6f209
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/autofs4/expire.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ static struct dentry *get_next_positive_subdir(struct dentry *prev,
/* 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;
}
Expand Down Expand Up @@ -186,6 +187,7 @@ static struct dentry *get_next_positive_dentry(struct dentry *prev,
/* 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;
}
Expand Down

0 comments on commit 1d6f209

Please sign in to comment.