Created attachment 265421 [details] Suggested fix Background: fstab(5) expects the first two fields (fs_spec and fs_file i.e. the device and the mountpoint) to escape spaces and tabs. The contents of these two fields are decoded using strunvis(3). Problem: When calling mount(8) with -p (to print mount information in fstab(5) format), spaces and tabs in the first two fields are not escaped and can thus not be distinguished from field separators. Solution: Use vis(3) to encode the first two fields when producing output in fstab(5) format (i.e. when called with -p). How to reproduce: # zfs create 'tank/test with spaces' # mount -p zroot/test with spaces /zroot/test with spaces zfs rw,noatime,nfsv4acls 0 0 Expected: # zfs create 'tank/test with spaces' # mount -p tank/test\swith\sspaces /zroot/test\swith\sspaces zfs rw,noatime,nfsv4acls 0 0 Please see the attached diff for a possible fix.
Sorry for the copy and paste error in the how to reproduce section. It should of course read: How to reproduce: # zfs create 'tank/test with spaces' # mount -p tank/test with spaces /tank/test with spaces zfs rw,noatime,nfsv4acls 0 0 Expected: # zfs create 'tank/test with spaces' # mount -p tank/test\swith\sspaces /tank/test\swith\sspaces zfs rw,noatime,nfsv4acls 0 0