Linux: Only use automount for volume roots
authorMarc Dionne <marc.dionne@your-file-system.com>
Wed, 29 Jul 2015 12:03:14 +0000 (09:03 -0300)
committerBenjamin Kaduk <kaduk@mit.edu>
Wed, 26 Aug 2015 15:20:34 +0000 (11:20 -0400)
As long as we avoid using directory aliases when crossing
a mount point (at the volume root), we should always get
to a given non root directory with the same dentry.
The mechanism added by commit de381aa0 ("Linux: Make dir
dentry aliases act like symlinks") is therefore only really
necessary for a volume root.

With kernel 4.2 it is not possible to tweak the "total link
count", resulting in ELOOP errors when looking up a path
with 40 or more directories that are being looked up for
the first time.  With this change, only mountpoints will
count against the limit.

Change-Id: Id0e5a51d579eee51ecb8d7fb575a7a30740ea70e
Reviewed-on: http://gerrit.openafs.org/11945
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/afs/LINUX/osi_vnodeops.c

index ae83935..4c8ae35 100644 (file)
@@ -1561,7 +1561,9 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp)
        d_prune_aliases(ip);
 
 #ifdef STRUCT_DENTRY_OPERATIONS_HAS_D_AUTOMOUNT
-       ip->i_flags |= S_AUTOMOUNT;
+       /* Only needed if this is a volume root */
+       if (vcp->mvstat == 2)
+           ip->i_flags |= S_AUTOMOUNT;
 #endif
     }
     /*