I find that I encounter EBUSY of device remove of thin device, the error message seems like:
DM Core error: low-level ioctl error due to nix error; ioctl number: 4, input header: Some(DeviceInfo { version: Version { major: 4, minor: 0, patch : 0 }, data_size: 16384, data_start: 312, target_count: 0, open_count: 0, flags: DmFlags(0x0), event_nr: 4222638, dev: Device { major: 0, minor: 0 }, name: Some(DmNameBuf { inn er: \\\"thin_dev_1\\\" }), uuid: None }), header result: Some(DeviceInfo { version: Version { major: 4, minor: 48, patch: 0 }, data_size: 16384, data_start: 312, target_count: 0, open_count: 0, flags: DmFlags(0x0), event_nr: 4222638, dev: Device { major: 0, minor: 0 }, name: Some(DmNameBuf { inner: \\\"thin_dev_1\\\" }), u uid: None }), error: EBUSY: Device or resource busy
I find that the device mapper will try about 5 times when ioctl meet EBUSY errors, but it still fails in my scenario. When it fails, I monitor which process preventing it from delete the thin device, via the lsof tool. I find that a process named (udev-worker) holds reference to the thin device.
I am not familiar with udev (systemd-udevd), I guess the DM_DEV_REMOVE_CMD ioctl triggers the udev to handle events like "remove" events? But I am not sure that will udev receive and process any event before the ioctl has actually succeed (the DM_DEV_REMOVE_CMD failed with EBUSY and the thin device has not been deleted).
Does anyone have ideas on solve this problem?
I find that I encounter EBUSY of device remove of thin device, the error message seems like:
I find that the device mapper will try about 5 times when ioctl meet EBUSY errors, but it still fails in my scenario. When it fails, I monitor which process preventing it from delete the thin device, via the
lsoftool. I find that a process named(udev-worker)holds reference to the thin device.I am not familiar with udev (systemd-udevd), I guess the
DM_DEV_REMOVE_CMDioctl triggers the udev to handle events like "remove" events? But I am not sure that will udev receive and process any event before the ioctl has actually succeed (theDM_DEV_REMOVE_CMDfailed with EBUSY and the thin device has not been deleted).Does anyone have ideas on solve this problem?