]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
autofs4 - fix get_next_positive_subdir()
authorIan Kent <raven@themaw.net>
Mon, 6 Aug 2012 01:37:47 +0000 (09:37 +0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 Aug 2012 18:58:28 +0000 (11:58 -0700)
commita45440f05e9ebc26f2a375df911823fdef5b5281
tree68f36bc8cd8a8a32a41c6a4f3ee349ec29c9de80
parent63ca5f1d17a4eecaec3149982223fe89e55a568f
autofs4 - fix get_next_positive_subdir()

Following a report of a crash during an automount expire I found that
the locking in fs/autofs4/expire.c:get_next_positive_subdir() was wrong.
Not only is the locking wrong but the function is more complex than it
needs to be.

The function is meant to calculate (and dget) the next entry in the list
of directories contained in the root of an autofs mount point (an autofs
indirect mount to be precise). The main problem was that the d_lock of
the owner of the list was not being taken when walking the list, which
lead to list corruption under load. The only other lock that needs to
be taken is against the next dentry candidate so it can be checked for
usability.

Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/autofs4/expire.c