| Summary: | zfs receive mounts received dataset even if -u is given | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | VK <vlad-fbsd> | ||||
| Component: | kern | Assignee: | Andriy Gapon <avg> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | CC: | avg | ||||
| Priority: | --- | Keywords: | patch | ||||
| Version: | 10.2-RELEASE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
VK
2015-11-20 21:54:13 UTC
I think that the received filesystem got mounted because it was received as zbackup/backup and zbackup/backup was mounted before. Still this is a bug, of course. But you can try to repeat the procedure with zbackup/backup unmounted before doing send | receive. Yes, I just tried sending to imported but unmounted zbackup and indeed, it did not automount. okay, so this must be the same issue as https://www.illumos.org/issues/6412 As suggested by Allan Jude on IRC, I tried sending to a nonexisting dataset and without the -d flag and it autocreated the receiving dataset but did not automount it. root@freebsd:~ # zfs mount zroot / zbackup /zbackup zbackup/backup /zbackup/backup root@freebsd:~ # zfs send zroot@test-snapshot | zfs receive -Fu zbackup/backup/foo root@freebsd:~ # zfs list NAME USED AVAIL REFER MOUNTPOINT zbackup 829M 3.03G 19K /zbackup zbackup/backup 829M 3.03G 19K /zbackup/backup zbackup/backup/foo 829M 3.03G 829M / zroot 898M 2.97G 897M / root@freebsd:~ # zfs mount zroot / zbackup /zbackup zbackup/backup /zbackup/backup Created attachment 163360 [details]
proposed patch for testing
Please test the attached patch using your original procedure.
I tested it against r291085, the line numbers were different but I located the only place in the file where the code appears. It looks like that fixed it. Tried the procedure again and the dataset is not remounted with -Fdu onto existing dataset. Thank you! A commit references this bug: Author: avg Date: Sun Apr 3 07:40:34 UTC 2016 New revision: 297520 URL: https://svnweb.freebsd.org/changeset/base/297520 Log: zfs receive: -u can be ignored sometimes When force-receiving a filesystem that was already mounted the re-created filesystem is mounted despite -u flag. Also see https://www.illumos.org/issues/6412. PR: 204705 Tested by: Vladimir Krstulja <vlad-fbsd@acheronmedia.com> MFC after: 2 weeks X-Needs-Upstreaming: illumos Changes: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c A commit references this bug: Author: avg Date: Tue Apr 19 12:14:15 UTC 2016 New revision: 298264 URL: https://svnweb.freebsd.org/changeset/base/298264 Log: MFC r297520: zfs receive: -u can be ignored sometimes PR: 204705 Changes: _U stable/10/ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c A commit references this bug: Author: avg Date: Tue Apr 19 12:14:53 UTC 2016 New revision: 298265 URL: https://svnweb.freebsd.org/changeset/base/298265 Log: MFC r297520: zfs receive: -u can be ignored sometimes PR: 204705 Changes: _U stable/9/cddl/contrib/opensolaris/lib/libzfs/ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c |