]> git.proxmox.com Git - mirror_zfs-debian.git/commitdiff
Avoid ELOOP on auto-mounted snapshots
authorNed Bass <bass6@llnl.gov>
Wed, 12 Dec 2012 23:55:51 +0000 (15:55 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 13 Dec 2012 16:57:11 +0000 (08:57 -0800)
Ensure that the path member pointers are associated with the
newly-mounted snapshot when zpl_snapdir_automount() returns.  Otherwise
the follow_automount() function may be called repeatedly, leading to an
incorrect ELOOP error return. This problem was observed as a 'Too many
levels of symbolic links' error from user-space commands accessing an
unmounted snapshot in the .zfs/snapshot directory.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #816

module/zfs/zpl_ctldir.c

index 7dfaf6ebcc456a002d750bfd338efe015ab3d922..a2d8fa9fedb58d3b905ffd7c93081c9d2d1bea3e 100644 (file)
@@ -356,6 +356,13 @@ zpl_snapdir_automount(struct path *path)
        if (error)
                return ERR_PTR(error);
 
+       /*
+        * Ensure path->dentry points to the dentry for the root of the
+        * newly-mounted snapshot, otherwise this function may be called
+        * repeatedly which can lead to an incorrect ELOOP error return.
+        */
+       follow_up(path);
+
        /*
         * Rather than returning the new vfsmount for the snapshot we must
         * return NULL to indicate a mount collision.  This is done because