Skip to content

Commit 4810a10

Browse files
loli10Ktonyhutter
authored andcommitted
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. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: loli10K <[email protected]> Closes #1791 Closes #6429 Closes #6437
1 parent ae5b4a0 commit 4810a10

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

etc/systemd/system/zfs-mount.service.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Before=local-fs.target
1111
Type=oneshot
1212
RemainAfterExit=yes
1313
ExecStart=@sbindir@/zfs mount -a
14-
WorkingDirectory=-/sbin/
1514

1615
[Install]
1716
WantedBy=zfs-share.service

lib/libzfs/libzfs_mount.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,9 @@ zfs_is_mountable(zfs_handle_t *zhp, char *buf, size_t buflen,
344344
static int
345345
do_mount(const char *src, const char *mntpt, char *opts)
346346
{
347-
char *argv[8] = {
347+
char *argv[9] = {
348348
"/bin/mount",
349+
"--no-canonicalize",
349350
"-t", MNTTYPE_ZFS,
350351
"-o", opts,
351352
(char *)src,

0 commit comments

Comments
 (0)