提交 d3f2820f 编写于 作者: E Erik Skultety

nodedev: udev: Remove the udevEventHandleCallback on fatal error

So we have a sanity check for the udev monitor fd. Theoretically, it
could happen that the udev monitor fd changes (due to our own wrongdoing,
hence the 'sanity' here) and if that happens it means we are handling an
event from a different entity than we think, thus we should remove the
handle if someone somewhere somehow hits this hypothetical case.
Signed-off-by: NErik Skultety <eskultet@redhat.com>
上级 6167d849
......@@ -1611,10 +1611,20 @@ udevEventHandleCallback(int watch ATTRIBUTE_UNUSED,
udev_fd = udev_monitor_get_fd(udev_monitor);
if (fd != udev_fd) {
udevPrivate *priv = driver->privateData;
virReportError(VIR_ERR_INTERNAL_ERROR,
_("File descriptor returned by udev %d does not "
"match node device file descriptor %d"),
fd, udev_fd);
/* this is a non-recoverable error, let's remove the handle, so that we
* don't get in here again because of some spurious behaviour and report
* the same error multiple times
*/
virEventRemoveHandle(priv->watch);
priv->watch = -1;
goto cleanup;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册