zfs recv doesn't always respect -x mountpoint
#17240
Labels
Type: Defect
Incorrect behavior (e.g. crash, hang)
-x mountpoint
#17240
System information
Describe the problem you're observing
Under some specific circumstances (I managed to suss out two),
zfs recv
does not respect the-x mountpoint
flag, instead transferring the mount point from the source and mounting it at an unintended path.Describe how to reproduce the problem
If you send a filesystem without properties, and then later send an incremental update with properties, a
-x mountpoint
is not respected:Second problematic case. If there was an unrelated filesystem at the destination that you overwrite with
-F
,-x mountpoint
is ignored:This made me suspect maybe the point is whether or not a set
mountpoint
existed was what caused the problem, but the following shows that it also happens ifmountpoint
was already set:so the problem is still there if the original unrelated filesystem already had a
mountpoint
set.Doing just the most obvious thing does not lead to issues:
Here we see that
-x mountpoint
does actually work, and in the most common case of transferring your filesystems to a backup server, it all works swimmingly, until you do one of the things above. Obviously you do this with a filesystem withmountpoint=/
for maximum damage, as Murphy demands of you.I managed to find two cases where this happened, but of course I don't know if there are more. I had similar problems before, with older versions of OpenZFS. I don't think it's a new bug.
Thanks for developing and maintaining OpenZFS!
The text was updated successfully, but these errors were encountered: