diff --git a/acinclude.m4 b/acinclude.m4 index 3937f15a20..74fc77619f 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -958,6 +958,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) AC_CHECK_LINUX_STRUCT([task_struct], [sigmask_lock], [sched.h]) AC_CHECK_LINUX_STRUCT([task_struct], [tgid], [sched.h]) AC_CHECK_LINUX_STRUCT([task_struct], [thread_info], [sched.h]) + AC_CHECK_LINUX_STRUCT([task_struct], [total_link_count], [sched.h]) LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM dnl Check for typed structure elements diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 62abc471d8..481ce87847 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -1390,9 +1390,17 @@ afs_dentry_automount(afs_linux_path_t *path) { struct dentry *target; - /* avoid symlink resolution limits when resolving; we cannot contribute to - * an infinite symlink loop */ + /* + * Avoid symlink resolution limits when resolving; we cannot contribute to + * an infinite symlink loop. + * + * On newer kernels the field has moved to the private nameidata structure + * so we can't adjust it here. This may cause ELOOP when using a path with + * 40 or more directories that are not already in the dentry cache. + */ +#if defined(STRUCT_TASK_STRUCT_HAS_TOTAL_LINK_COUNT) current->total_link_count--; +#endif target = canonical_dentry(path->dentry->d_inode);