event_notifier: Remove assertions
PATCH 1/1 event_notifier: Remove assertions
Commit e3b12d0c55e4 ("util/event_notifier: more strict API") added asserts for uninitialized file descriptors in the various helper routines, because it presumes that such a thing is always in place once a couple of problematic paths were corrected in that commit.
Not all paths appear to adhere to this, however. s390x breaks because there is no config notifier so things that rely on vhost (virtio-net-ccw, vhost-vsock-ccw, etc.) fail on this assertion when called from vhost_start_config_intr().
Remove these new assertions from the API; can try again another day.
--- util/event_notifier-posix.c | 5 ----- 1 file changed, 5 deletions(-)
util/event_notifier-posix.c +0 -5
@@ -27,7 +27,6 @@*/ void event_notifier_init_fd (EventNotifier *e,int fd) { -assert (fd >=0 ); e->rfd = fd; e->wfd = fd; e->initialized = true;
@@ -97,15 +96,11 @@ void event_notifier_cleanup(EventNotifier *e)int event_notifier_get_fd (const EventNotifier *e) { -assert (e->initialized); -assert (e->rfd >=0 );return e->rfd; }int event_notifier_get_wfd (const EventNotifier *e) { -assert (e->initialized); -assert (e->wfd >=0 );return e->wfd; }
Signature · 1 line
2.53.0
Quoted 37 lines · Eric Farman
Commit
e3b12d0c55e4("util/event_notifier: more strict API") added asserts for uninitialized file descriptors in the various helper routines, because it presumes that such a thing is always in place once a couple of problematic paths were corrected in that commit.Not all paths appear to adhere to this, however. s390x breaks because there is no config notifier so things that rely on vhost (virtio-net-ccw, vhost-vsock-ccw, etc.) fail on this assertion when called from
vhost_start_config_intr().Remove these new assertions from the API; can try again another day.
Link https://lore.kernel.org/qemu-devel/CAFEAcA8+x3Bf0LDyh9hU6J9N-A8Lii6fb8orB2Coucn-fAYtTA@mail.gmail.com/ open hereFixes e3b12d0c55e4 ("util/event_notifier: more strict API")Signed-off-by Eric Farman <[email protected]>--- util/event_notifier-posix.c | 5 ----- 1 file changed, 5 deletions(-)util/event_notifier-posix.c +0
-3@@ -27,7 +27,6 @@*/ void event_notifier_init_fd (EventNotifier *e,int fd) { -assert (fd >=0 ); e->rfd = fd; e->wfd = fd; e->initialized = true;@@ -97,15 +96,11 @@ void event_notifier_cleanup(EventNotifier *e)int event_notifier_get_fd (const EventNotifier *e) { -assert (e->initialized); -assert (e->rfd >=0 );
util/event_notifier-posix.c void event_notifier_cleanup(EventNotifier *e) · line 106
Quoted 10 lines
util/event_notifier-posix.c +0
-2return e->rfd; }int event_notifier_get_wfd (const EventNotifier *e) { -assert (e->initialized); -assert (e->wfd >=0 );return e->wfd; }
In my opinion "[PATCH for 11.2 v2] vhost: only use config notifier when exists/initialized"[1] is better.
Removing assertions hides problems (like sending uninitialized fd to ioctl, fixed by [1])
Signature · 2 lines
Best regards, Vladimir
Am 04.11.26 um 11:29 schrieb Vladimir Sementsov-Ogievskiy:
Quoted 50 lines · Eric Farman
Quoted 34 lines
Commit
e3b12d0c55e4("util/event_notifier: more strict API") added asserts for uninitialized file descriptors in the various helper routines, because it presumes that such a thing is always in place once a couple of problematic paths were corrected in that commit.Not all paths appear to adhere to this, however. s390x breaks because there is no config notifier so things that rely on vhost (virtio-net-ccw, vhost-vsock-ccw, etc.) fail on this assertion when called from
vhost_start_config_intr().Remove these new assertions from the API; can try again another day.
Link https://lore.kernel.org/qemu-devel/CAFEAcA8+x3Bf0LDyh9hU6J9N-A8Lii6fb8orB2Coucn-fAYtTA@mail.gmail.com/ open hereFixes e3b12d0c55e4 ("util/event_notifier: more strict API")Signed-off-by Eric Farman <[email protected]>---
util/event_notifier-posix.c| 5 -----1 file changed, 5 deletions(-)util/event_notifier-posix.c +0
-1@@ -27,7 +27,6 @@*/ void event_notifier_init_fd(EventNotifier *e, int fd) { - assert(fd >= 0); e->rfd = fd; e->wfd = fd; e->initialized = true;@@ -97,15 +96,11 @@ void event_notifier_cleanup(EventNotifier *e) int event_notifier_get_fd(const EventNotifier *e) {util/event_notifier-posix.c void event_notifier_cleanup(EventNotifier *e) · line 103
Quoted 10 lines
util/event_notifier-posix.c +0
-4- assert(e->initialized); - assert(e->rfd >= 0); return e->rfd; } int event_notifier_get_wfd(const EventNotifier *e) { - assert(e->initialized); - assert(e->wfd >= 0); return e->wfd; }In my opinion "[PATCH for 11.2 v2] vhost: only use config notifier when exists/initialized"[1] is better.
Quoted 2 lines
Removing assertions hides problems (like sending uninitialized fd to ioctl, fixed by [1])
In any case e3b12d0c55e4 introduced a regression so can we get the revert or the fix accepted asap please?