Bug #10215
lofiadm -la fails after lofiadm -a / lofiadm -d
100%
Description
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.
Related issues
Updated by Toomas Soome about 2 years ago
Alexander Pyhalov wrote:
The following test case fails:
[...]
I did figure out what does happen:
we have device name cache, this cache is updated (add/delete) based on sysevent messages because the device names are created by devfsadmd, and the lofi driver does read the names from this cache.
We do have wait loop for case the name is not yet there, because the sysevent add name messages will take time to arrive, but also the name delete messages will take the time... so the driver will get the old name.
The fix is that we need to initiate the name removal from lofi driver (on lofiadm -d).
Updated by Toomas Soome about 2 years ago
- Category set to driver - device drivers
- Assignee set to Toomas Soome
- % Done changed from 0 to 90
- Tags deleted (
needs-triage)
Updated by Electric Monk almost 2 years ago
- Status changed from New to Closed
- % Done changed from 90 to 100
git commit 45ca53447fde2f014d6d62f6bbbfc0b97ae011dd
commit 45ca53447fde2f014d6d62f6bbbfc0b97ae011dd Author: Toomas Soome <tsoome@me.com> Date: 2019-01-17T15:47:59.000Z 10215 lofiadm -la fails after lofiadm -a / lofiadm -d Reviewed by: Igor Kozhukhov <igor@dilos.org> Reviewed by: Gergő Doma <domag02@gmail.com> Reviewed by: Andy Fiddaman <andy@omniosce.org> Approved by: Dan McDonald <danmcd@joyent.com>
Updated by Andy Fiddaman over 1 year ago
- Related to Bug #11072: Deadlock in lofi after 11043 added