diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index a6fdf4ec85..2ca0aa152f 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -1305,6 +1305,24 @@ afs_linux_dentry_revalidate(struct dentry *dp, int flags) good_dentry: valid = 1; + goto done; + + bad_dentry: + valid = 0; +#ifndef D_INVALIDATE_IS_VOID + /* When (v3.18) d_invalidate was converted to void, it also started + * being called automatically from revalidate, and automatically + * handled: + * - shrink_dcache_parent + * - automatic detach of submounts + * - d_drop + * Therefore, after that point, OpenAFS revalidate logic no longer needs + * to do any of those things itself for invalid dentry structs. We only need + * to tell VFS it's invalid (by returning 0), and VFS will handle the rest. + */ + if (have_submounts(dp)) + valid = 1; +#endif done: /* Clean up */ @@ -1315,6 +1333,7 @@ afs_linux_dentry_revalidate(struct dentry *dp, int flags) if (credp) crfree(credp); +#ifndef D_INVALIDATE_IS_VOID if (!valid) { /* * If we had a negative lookup for the name we want to forcibly @@ -1327,15 +1346,9 @@ afs_linux_dentry_revalidate(struct dentry *dp, int flags) } else d_invalidate(dp); } - +#endif return valid; - bad_dentry: - if (have_submounts(dp)) - valid = 1; - else - valid = 0; - goto done; } static void