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 <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #9381
Closes #9384
behlendorf authored Oct 4, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 2cc479d commit 6bd4f45
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion module/os/linux/zfs/zfs_ctldir.c
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 6bd4f45

Please sign in to comment.