lofiadm -la fails after lofiadm -a / lofiadm -d
The following test case fails:
# test=`lofiadm -a $(mktemp)`; lofiadm -d $test; test=`lofiadm -la $(mktemp)`; lofiadm: /dev/lofi/1p0 was not created: No such file or directory
The labeled lofi device names are allocated (created) in devfsadm framework and announced via sysevent mechanism and cached in kernel. The lofi will wait for the name updates if the cache has no entry yet, but when the unmap is performed, the cache flush can be delayed too. Therefore the cache flush must be initiated while we are performing unmap operation.
The fix is tested by running the line above, also by running just lofiadm -a/lofiadm -d.