Skip to content

Commit af54d77

Browse files
Mukesh Ojhagregkh
authored andcommitted
devcoredump: Send uevent once devcd is ready
dev_coredumpm() creates a devcoredump device and adds it to the core kernel framework which eventually end up sending uevent to the user space and later creates a symbolic link to the failed device. An application running in userspace may be interested in this symbolic link to get the name of the failed device. In a issue scenario, once uevent sent to the user space it start reading '/sys/class/devcoredump/devcdX/failing_device' to get the actual name of the device which might not been created and it is in its path of creation. To fix this, suppress sending uevent till the failing device symbolic link gets created and send uevent once symbolic link is created successfully. Fixes: 833c954 ("device coredump: add new device coredump class") Signed-off-by: Mukesh Ojha <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 76cab6f commit af54d77

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/base/devcoredump.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ void dev_coredumpm(struct device *dev, struct module *owner,
362362
devcd->devcd_dev.class = &devcd_class;
363363

364364
mutex_lock(&devcd->mutex);
365+
dev_set_uevent_suppress(&devcd->devcd_dev, true);
365366
if (device_add(&devcd->devcd_dev))
366367
goto put_device;
367368

@@ -376,6 +377,8 @@ void dev_coredumpm(struct device *dev, struct module *owner,
376377
"devcoredump"))
377378
dev_warn(dev, "devcoredump create_link failed\n");
378379

380+
dev_set_uevent_suppress(&devcd->devcd_dev, false);
381+
kobject_uevent(&devcd->devcd_dev.kobj, KOBJ_ADD);
379382
INIT_DELAYED_WORK(&devcd->del_wk, devcd_del);
380383
schedule_delayed_work(&devcd->del_wk, DEVCD_TIMEOUT);
381384
mutex_unlock(&devcd->mutex);

0 commit comments

Comments
 (0)