Skip to content

Commit 9000a9f

Browse files
loli10Kbehlendorf
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 openzfs#1791 Closes openzfs#6429 Closes openzfs#6437
1 parent f763c3d commit 9000a9f

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
@@ -345,8 +345,9 @@ zfs_is_mountable(zfs_handle_t *zhp, char *buf, size_t buflen,
345345
static int
346346
do_mount(const char *src, const char *mntpt, char *opts)
347347
{
348-
char *argv[8] = {
348+
char *argv[9] = {
349349
"/bin/mount",
350+
"--no-canonicalize",
350351
"-t", MNTTYPE_ZFS,
351352
"-o", opts,
352353
(char *)src,

0 commit comments

Comments
 (0)