From 948553646ae19dc3f3949fa1c3c0665abc1a4e75 Mon Sep 17 00:00:00 2001 From: loli10K Date: Tue, 1 Aug 2017 21:34:05 +0200 Subject: [PATCH] Disable mount(8) canonical paths in do_mount() By default the mount(8) command, as invoked by 'zfs mount', will try to resolve any path parameter in its canonical form: this could lead to mount failures when the cwd contains a symlink having the same name of the dataset being mounted. Fix this by explicitly disabling mount(8) path canonicalization. Signed-off-by: loli10K --- etc/systemd/system/zfs-mount.service.in | 1 - lib/libzfs/libzfs_mount.c | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/systemd/system/zfs-mount.service.in b/etc/systemd/system/zfs-mount.service.in index 36dc3be507f9..0664fd9e7665 100644 --- a/etc/systemd/system/zfs-mount.service.in +++ b/etc/systemd/system/zfs-mount.service.in @@ -11,7 +11,6 @@ Before=local-fs.target Type=oneshot RemainAfterExit=yes ExecStart=@sbindir@/zfs mount -a -WorkingDirectory=-/sbin/ [Install] WantedBy=zfs-share.service diff --git a/lib/libzfs/libzfs_mount.c b/lib/libzfs/libzfs_mount.c index 57f363f2a8b9..b2d082e17c46 100644 --- a/lib/libzfs/libzfs_mount.c +++ b/lib/libzfs/libzfs_mount.c @@ -345,8 +345,9 @@ zfs_is_mountable(zfs_handle_t *zhp, char *buf, size_t buflen, static int do_mount(const char *src, const char *mntpt, char *opts) { - char *argv[8] = { + char *argv[9] = { "/bin/mount", + "--no-canonicalize", "-t", MNTTYPE_ZFS, "-o", opts, (char *)src,