]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Disable mount(8) canonical paths in do_mount()
authorLOLi <loli10K@users.noreply.github.com>
Mon, 21 Aug 2017 16:31:54 +0000 (18:31 +0200)
committerTony Hutter <hutter2@llnl.gov>
Mon, 21 Aug 2017 23:46:55 +0000 (16:46 -0700)
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.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #1791
Closes #6429
Closes #6437

etc/systemd/system/zfs-mount.service.in
lib/libzfs/libzfs_mount.c

index 36dc3be507f96b3d22b3fc517488032c79e568a6..0664fd9e7665ae55cd5cbf328d0c4937d046f224 100644 (file)
@@ -11,7 +11,6 @@ Before=local-fs.target
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=@sbindir@/zfs mount -a
-WorkingDirectory=-/sbin/
 
 [Install]
 WantedBy=zfs-share.service
index a66278627134a5426a69c93775d801fb0904735d..dd1617d64d247960d390ead24441c093d102a6a5 100644 (file)
@@ -344,8 +344,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,