sapcc / swift-drive-autopilot

Finds and mounts Swift storage drives (also from within a container)
Apache License 2.0
7 stars 0 forks source link

crash when device file disappears while LUKS container is open #24

Open majewsky opened 5 years ago

majewsky commented 5 years ago

When this happens:

$ sudo cryptsetup status S4D17XYS0000K705ATH0
/dev/mapper/S4D17XYS0000K705ATH0 is active and is in use.
  type:    n/a
  cipher:  aes-xts-plain64
  keysize: 256 bits
  device:  (null)
  offset:  4096 sectors
  size:    11721041072 sectors
  mode:    read/write

Then s-d-a gets confused by device: (null) and crashes when trying to look at the device /dev/(null). To reproduce,

echo offline > /sys/block/sdc/device/state
echo 1 > /sys/block/sdc/device/delete