Skip to content

Commit

Permalink
Fix automount for root filesystems
Browse files Browse the repository at this point in the history
Commit 093bb64 resolved an automount failures for chroot'd processes
but inadvertently broke automounting for root filesystems where the
vfs_mntpoint is NULL.  Resolve the issue by checking for NULL in order
to generate the correct path.

Reviewed-by: Tom Caputi <tcaputi@datto.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #9381
Closes #9384
  • Loading branch information
behlendorf authored and tonyhutter committed Jan 22, 2020
1 parent b43893d commit 5a1bf9e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion module/zfs/zfs_ctldir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,8 @@ zfsctl_snapshot_mount(struct path *path, int flags)
* on mount.zfs(8).
*/
snprintf(full_path, MAXPATHLEN, "%s/.zfs/snapshot/%s",
zfsvfs->z_vfs->vfs_mntpoint, dname(dentry));
zfsvfs->z_vfs->vfs_mntpoint ? zfsvfs->z_vfs->vfs_mntpoint : "",
dname(dentry));

/*
* Multiple concurrent automounts of a snapshot are never allowed.
Expand Down

0 comments on commit 5a1bf9e

Please sign in to comment.