Skip to content

EBUSY when remove thin device #1007

Description

@huang-jl

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions