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

Commit f37b7e9d 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"...

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

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2628999



Change-Id: Id3b06d563562f8691b0fce8387b8c2e2bdf31b8f
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 01774360 d65601d1
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;
    }