RFE: ZFS filesystem dataset option to allow overlay mounts
Currently the only way I know to overlay mount a ZFS filesystem into a potentially non-empty directory is to specify this filesystem as mountpoint=legacy and mounting it with "-O" option, i.e. via /etc/vfstab file.
An example to illustrate the usecase would be split root-fs hierarchy we use with separate /usr /opt /var/adm /var/log /var/crash /var/cores /var/mail and so on (to constrain potential space hogs with separate quotas), or for a more standard example - a single separate dataset rpool/ROOT/bename/var.
The mountpoint such as /var/ directory (in bename dataset), or in my example more likely /var/adm and /var/log, might be "poisoned" by being written to during single-user mode or on other occasions. After this, standard ZFS mount-on-import fails, and the system comes up with "filesystem/local" or "filesystem/usr" services in maintenance state, SSH doesn't start, system becomes generally unavailable unless remote console exists.
A workaround is described above - via /etc/vfstab.
A more logical solution would be to embed the overlay-mount option into specific datasets' attributes and have them work properly during ZFS mount-on-import at system startup.