Skip to content

Commit 3b39a9e

Browse files
committed
Don't SIGABORT if device-mapper doesn't generate uevent for DeleteDevice
It looks like in some rare scenarios device-mapper won't create an uevent while handling DM_DEV_REMOVE ioctl. Since failure to generate uevent will result in ueventd not cleaning up /dev paths in user space, it should be ok to just fail DeleteDevice call without aborting the entire process. Test: presubmit Bug: 171266986 Change-Id: Iece28e6e02c35ac4bf33b9be74dfe1bbbb466bd4
1 parent f7c47f8 commit 3b39a9e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs_mgr/libdm/dm.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,10 @@ bool DeviceMapper::DeleteDevice(const std::string& name,
111111

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

117119
if (timeout_ms <= std::chrono::milliseconds::zero()) {
118120
return true;

0 commit comments

Comments
 (0)