Skip to content

Commit

Permalink
Disable mount(8) canonical paths in do_mount()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
loli10K authored and Fabian-Gruenbichler committed Sep 28, 2017
1 parent 0da5ddd commit 8c4f958
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion etc/systemd/system/zfs-mount.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Before=local-fs.target
Type=oneshot
RemainAfterExit=yes
ExecStart=@sbindir@/zfs mount -a
WorkingDirectory=-/sbin/

[Install]
WantedBy=zfs-share.service
Expand Down
3 changes: 2 additions & 1 deletion lib/libzfs/libzfs_mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8c4f958

Please sign in to comment.