Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 867458fa authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "libdm: don't expect uevent for devices that have never been activated" am: 684a66c8

parents c7f7743f 684a66c8
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -106,6 +106,10 @@ bool DeviceMapper::DeleteDevice(const std::string& name,
    if (!GetDeviceUniquePath(name, &unique_path)) {
        LOG(ERROR) << "Failed to get unique path for device " << name;
    }
    // Expect to have uevent generated if the unique path actually exists. This may not exist
    // if the device was created but has never been activated before it gets deleted.
    bool need_uevent = !unique_path.empty() && access(unique_path.c_str(), F_OK) == 0;

    struct dm_ioctl io;
    InitIo(&io, name);

@@ -116,7 +120,7 @@ bool DeviceMapper::DeleteDevice(const std::string& name,

    // Check to make sure appropriate uevent is generated so ueventd will
    // do the right thing and remove the corresponding device node and symlinks.
    if ((io.flags & DM_UEVENT_GENERATED_FLAG) == 0) {
    if (need_uevent && (io.flags & DM_UEVENT_GENERATED_FLAG) == 0) {
        LOG(ERROR) << "Didn't generate uevent for [" << name << "] removal";
        return false;
    }