Project

General

Profile

Actions

Bug #11072

closed

Deadlock in lofi after 11043

Added by Andy Fiddaman about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
kernel
Start date:
2019-05-28
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Related issues

Related to illumos gate - Bug #11043: lofiadm -la still fails after 10215ClosedToomas Soome2019-05-16

Actions
Related to illumos gate - Bug #10215: lofiadm -la fails after lofiadm -a / lofiadm -dClosedToomas Soome2019-01-11

Actions
Actions #1

Updated by Andy Fiddaman about 4 years ago

  • Tags deleted (needs-triage)
  • Subject changed from Deadlock in lofi after to Deadlock in lofi after 11043
  • Category set to kernel
  • Assignee set to Andy Fiddaman

Following the integration of 11043, a deadlock is possible in the lofi code. For a labelled device, a condition variable is used to wait for notification of the device name which has been assigned. However, if the cache is populated with the temporary /dev/rlofi/ entry, then the code does not wait on the condition variable and notify_lofi() cannot acquire the mutex required to update the cache.

fffffe16ebed9b40 SLEEP    MUTEX                   1
                 swtch+0x141
                 turnstile_block+0x21a
                 mutex_vector_enter+0x3a3
                 notify_lofi+0xc8
                 log_usr_sysevent+0x69
                 modctl_modevents+0x113
                 modctl+0x23d
                 _sys_sysenter_post_swapgs+0x153

fffffe16ecebd880 ONPROC   <NONE>                  1
                 strcmp+0x18
                 nvt_lookup_name_type+0x58
                 nvlist_lookup_common+0x4e
                 nvlist_lookup_string+0x23
                 lofi_copy_devpath+0xf7
                 lofi_map_file+0x515
                 lofi_ioctl+0x1fb
                 cdev_ioctl+0x39
                 spec_ioctl+0x60
                 fop_ioctl+0x55
                 ioctl+0x9b
                 _sys_sysenter_post_swapgs+0x153

> lofi_devlink_cache::print ln_data | ::nvlist
1
    version=00000001
    phys_path='/pseudo/lofi@1'
    dev_name='/dev/rlofi/1'
    driver_name='lofi'
    instance=00000001
    prop-ddi-kernel-ioctl(unknown)
    prop-zone='global'
    prop-instance=00000001
Actions #2

Updated by Andy Fiddaman about 4 years ago

  • Related to Bug #11043: lofiadm -la still fails after 10215 added
Actions #3

Updated by Andy Fiddaman about 4 years ago

  • Related to Bug #10215: lofiadm -la fails after lofiadm -a / lofiadm -d added
Actions #4

Updated by Andy Fiddaman about 4 years ago

Review at: https://www.illumos.org/rb/r/1861/

For testing I ran the OmniOS media creation process successfully 10 times in a loop. This was previously always hanging and uses lofiadm -la twice: once for converting the .iso to a hybrid image and once for creating the pure USB image.

Actions #5

Updated by Electric Monk about 4 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 84ce06cea75304aa6dec12e94975d5372dd9c672

commit  84ce06cea75304aa6dec12e94975d5372dd9c672
Author: Andy Fiddaman <omnios@citrus-it.co.uk>
Date:   2019-05-29T16:26:48.000Z

    11072 Deadlock in lofi after 11043
    Reviewed by: Toomas Soome <tsoome@me.com>
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Reviewed by: Igor Kozhukhov <igor@dilos.org>
    Approved by: Gordon Ross <gwr@nexenta.com>

Actions

Also available in: Atom PDF