diff options
author | Brian Behlendorf <[email protected]> | 2019-10-04 12:30:51 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2019-10-04 12:30:51 -0700 |
commit | 6bd4f4545d3d334442fbe87d40ad0e0542703ce6 (patch) | |
tree | b5dd68d31b02cec719dc2f11d0e7f658c34a3f11 | |
parent | 2cc479d049eb84b9cd7da9f2d64266429f3c3201 (diff) |
Fix automount for root filesystems
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
-rw-r--r-- | module/os/linux/zfs/zfs_ctldir.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/module/os/linux/zfs/zfs_ctldir.c b/module/os/linux/zfs/zfs_ctldir.c index 1e61ef06d..3b2a6eb82 100644 --- a/module/os/linux/zfs/zfs_ctldir.c +++ b/module/os/linux/zfs/zfs_ctldir.c @@ -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. |