mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
driver core: Limit the messages on a refused uevent
A write to a "uevent" file which is no valid action makes
kobject_synth_uevent() print a warning and uevent_store() an error every
time. This is generally considered a bad thing so rate limit these
messages.
Fixes: b0e37c0d8a ("net-sysfs: make sure objects belong to container's owner")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Link: https://patch.msgid.link/2026102718-conduit-glorious-a8dc@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0cc3ad8f4d
commit
a01c8e5b1d
|
|
@ -2847,7 +2847,9 @@ static ssize_t uevent_store(struct device *dev, const struct device_attribute *a
|
|||
rc = kobject_synth_uevent(&dev->kobj, buf, count);
|
||||
|
||||
if (rc) {
|
||||
dev_err(dev, "uevent: failed to send synthetic uevent: %d\n", rc);
|
||||
dev_err_ratelimited(dev,
|
||||
"uevent: failed to send synthetic uevent: %d\n",
|
||||
rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -223,9 +223,9 @@ int kobject_synth_uevent(struct kobject *kobj, const char *buf, size_t count)
|
|||
out:
|
||||
if (r) {
|
||||
devpath = kobject_get_path(kobj, GFP_KERNEL);
|
||||
pr_warn("synth uevent: %s: %s\n",
|
||||
devpath ?: "unknown device",
|
||||
msg ?: "failed to send uevent");
|
||||
pr_warn_ratelimited("synth uevent: %s: %s\n",
|
||||
devpath ?: "unknown device",
|
||||
msg ?: "failed to send uevent");
|
||||
kfree(devpath);
|
||||
}
|
||||
return r;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user