Linux: osi_TryEvictVCache: Don’t skip the first dentry if D_ALIAS_IS_HLIST
An hlist doesn’t begin with a sentinel like a list does, so the old
code would skip the first dentry or crash with a NULL dereference if
there wasn’t one. Use the kernel’s list_for_each_entry or
hlist_for_each_entry macros instead of trying to do it manually.
Should fix a crash observed by Alex Chernyakhovsky on kernel 3.6 and
newer.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/9857
Reviewed-by: Alex Chernyakhovsky <achernya@mit.edu>
Tested-by: Alex Chernyakhovsky <achernya@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit
ad6e31d5fea221bf5eefcd35a416667bc7c1f9be)
Change-Id: Id8b31246067b5a718af91c8c206d5abd5210c558
Reviewed-on: http://gerrit.openafs.org/9898
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>