]> www.infradead.org Git - users/jedix/linux-maple.git/commit
autofs: use dentry flags to block walks during expire
authorIan Kent <raven@themaw.net>
Mon, 19 Sep 2016 21:44:12 +0000 (14:44 -0700)
committerJack Vogel <jack.vogel@oracle.com>
Wed, 24 Jan 2018 17:55:54 +0000 (09:55 -0800)
commit93e2b5bba76a2ef4ca890910d19b5506e0696f80
tree088e9d412df6921cde9574c53a1208c591571ecd
parent4db881f95b85f59cead22a1fe7e11b0003241602
autofs: use dentry flags to block walks during expire

Somewhere along the way the autofs expire operation has changed to hold
a spin lock over expired dentry selection.  The autofs indirect mount
expired dentry selection is complicated and quite lengthy so it isn't
appropriate to hold a spin lock over the operation.

Commit 47be61845c77 ("fs/dcache.c: avoid soft-lockup in dput()") added a
might_sleep() to dput() causing a WARN_ONCE() about this usage to be
issued.

But the spin lock doesn't need to be held over this check, the autofs
dentry info.  flags are enough to block walks into dentrys during the
expire.

I've left the direct mount expire as it is (for now) because it is much
simpler and quicker than the indirect mount expire and adding spin lock
release and re-aquires would do nothing more than add overhead.

Fixes: 47be61845c77 ("fs/dcache.c: avoid soft-lockup in dput()")
Link: http://lkml.kernel.org/r/20160912014017.1773.73060.stgit@pluto.themaw.net
Signed-off-by: Ian Kent <raven@themaw.net>
Reported-by: Takashi Iwai <tiwai@suse.de>
Tested-by: Takashi Iwai <tiwai@suse.de>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: NeilBrown <neilb@suse.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Orabug: 26032471
(cherry picked from commit 7cbdb4a286a60c5d519cb9223fe2134d26870d39)
Signed-off-by: Mingming Cao <mingming.cao@oracle.com>
Reviewed-by: Shirley Ma <shirley.ma@oracle.com>
fs/autofs4/expire.c