Scenario: - FreeBSD 12.4 latest patches - The following commands have been issued: [0]# zfs get canmount coconut.3/12/usr/local.OLD NAME PROPERTY VALUE SOURCE coconut.3/12/usr/local.OLD canmount off local [0]# zfs get mountpoint coconut.3/12/usr/local.OLD NAME PROPERTY VALUE SOURCE coconut.3/12/usr/local.OLD mountpoint /usr/local.OLD local [0]# zfs inherit mountpoint coconut.3/12/usr/local.OLD [0]# zfs get mountpoint coconut.3/12/usr/local.OLD NAME PROPERTY VALUE SOURCE coconut.3/12/usr/local.OLD mountpoint /usr/local received [0]# zfs inherit mountpoint coconut.3/12/usr/local.OLD [0]# zfs get mountpoint coconut.3/12/usr/local.OLD NAME PROPERTY VALUE SOURCE coconut.3/12/usr/local.OLD mountpoint /usr/local received [0]# zfs set mountpoint=/usr/local.OLD coconut.3/12/usr/local.OLD [0]# zfs get mountpoint coconut.3/12/usr/local.OLD NAME PROPERTY VALUE SOURCE coconut.3/12/usr/local.OLD mountpoint /usr/local.OLD local [0]# zfs inherit mountpoint coconut.3/12/usr/local.OLD [0]# zfs get mountpoint coconut.3/12/usr/local.OLD NAME PROPERTY VALUE SOURCE coconut.3/12/usr/local.OLD mountpoint /usr/local received [0]# zfs inherit -S mountpoint coconut.3/12/usr/local.OLD [0]# zfs get mountpoint coconut.3/12/usr/local.OLD NAME PROPERTY VALUE SOURCE coconut.3/12/usr/local.OLD mountpoint /usr/local received [0]# zfs set mountpoint=/usr/local.OLD coconut.3/12/usr/local.OLD [0]# zfs get mountpoint coconut.3/12/usr/local.OLD NAME PROPERTY VALUE SOURCE coconut.3/12/usr/local.OLD mountpoint /usr/local.OLD local [0]# zfs get mountpoint coconut.3/12/usr NAME PROPERTY VALUE SOURCE coconut.3/12/usr mountpoint /usr inherited from coconut.3/12 [0]# Result (see the scenario above): - The mountpoint of coconut.3/12/usr/local.OLD is never set to its inherited default of /usr/local.OLD, even if no -S flag is given to the "zfs inherit" command. In fact, "zfs inherit" behaves as if the -S flag is always specified. Expected result: - After "zfs inherit mountpoint coconut.3/12/usr/local.OLD", the mountpoint should be set to the parent's mountpoint plus the filesystem name, in this case to /usr/local.OLD. See also https://forums.freebsd.org/threads/zfs-inherit-mountpoint-after-zfs-rename-not-working.59965/ where the second post describes exactly the same issue. -- Martin
One more observation: Before I reproduced the commands shown in this PR, I had already tried various combinations of "zfs inherit mountpoint", "zfs set mountpoint", and also "zfs rename". On one such occasion after a "zfs rename" and "zfs set mountpoint", the mountpoint shown after "zfs inherit mountpoint" reverted back to the value it should have had before the "zfs rename" had been issued. Then, after another back-to-back "zfs inherit", it reverted back to the "received" value as shown in the PR. It "feels" as if some string handling is buggy. -- Martin