-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zfs mount failed if the cwd contains a symlink with the same name #1791
Comments
I can reproduce what you found with 0.6.2-r1 on gentoo:
BUT
Since it's not documented and can lead to unexpected behaviour (depending on the contents of cwd) i would argue that it is a bug. Just wrote this in another issue, but it fits here too: |
We've seen issues like this before, they're caused by Linux's generic mount command which assumes the passed mount argument is a path. We may be able to do something about this in the mount helper. |
This seems to be caused by First
then the
and finally
TL;DR: can this be fixed just by adding |
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
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
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
Hey folks,
Greetings from germany!
I've (possibly) found a bug while mounting a zfs filesystem, in my example named "data3", from a current working directory (cwd) which contains a symbolic link also called "data3". The destination where the symlink points to is not significant. In my example the cwd is: "/data/home/chriss_ubuntu" and the symblic link called "data3" points to "/data3".
It seems to me that the command "zfs mount data3" tries to follow the symbolic link and so the following error message appears:
filesystem '/data3' cannot be mounted, unable to open the dataset
cannot mount 'data3': Invalid argument
If I change the cwd to any other directory (without a symlink called "data3") the mount command works just fine.
strace (the short way):
11304 execve("/sbin/zfs", ["zfs", "mount", "data3"], [/* 29 vars /]) = 0
11304 lstat("/data3", {st_mode=S_IFDIR|0755, st_size=48, ...}) = 0
11304 openat(AT_FDCWD, "/data3", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 6
11305 execve("/bin/mount", ["/bin/mount", "-t", "zfs", "-o", "defaults,atime,dev,exec,rw,suid,"..., "data3", "/data3"], [/ 29 vars /]) = 0
11305 readlink("/data/home/chriss_ubuntu/data3", "/data3", 4096) = 6
11305 readlink("/data3", 0x7fff5fd0afe0, 4096) = -1 EINVAL (Invalid argument)
11306 execve("/sbin/mount.zfs", ["/sbin/mount.zfs", "/data3", "/data3", "-o", "rw,xattr,zfsutil"], [/ 25 vars */]) = 0
11306 stat("/data3", {st_mode=S_IFDIR|0755, st_size=48, ...}) = 0
11306 open("/data3", O_RDONLY) = 6
11306 lstat("/data3", {st_mode=S_IFDIR|0755, st_size=48, ...}) = 0
11306 write(2, "filesystem '/data3' cannot be mo"..., 66) = 66
11304 write(2, "cannot mount 'data3': Invalid ar"..., 39) = 39
Is this a bug or maybe an intentional behaviour?
Used versions:
Ubuntu 13.04 (amd64)
dkms 2.2.0.3-1.1ubuntu2+zfs6
raring1raringlibzfs1 0.6.2-1
mountall 2.48build1-zfs2
zfs-dkms 0.6.2-1
raringraringzfsutils 0.6.2-1
The text was updated successfully, but these errors were encountered: