diff --git a/module/zfs/zpl_ctldir.c b/module/zfs/zpl_ctldir.c index 7dfaf6ebcc45..a2d8fa9fedb5 100644 --- a/module/zfs/zpl_ctldir.c +++ b/module/zfs/zpl_ctldir.c @@ -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