kernel - another attempt at fixing checkloop panic
authorMarkus Pfeiffer <markus.pfeiffer@morphism.de>
Thu, 19 Jul 2012 15:49:02 +0000 (15:49 +0000)
committerMarkus Pfeiffer <markus.pfeiffer@morphism.de>
Fri, 20 Jul 2012 19:01:56 +0000 (19:01 +0000)
sys/kern/kern_device.c
sys/kern/sys_generic.c

index cfa7146..0804285 100644 (file)
@@ -444,8 +444,6 @@ dev_dkqfilter(cdev_t dev, struct knote *kn)
 
        if (error == 0) 
                return(ap.a_result);
-       else if (error == EOPNOTSUPP)
-               return(EOPNOTSUPP);
        return(ENODEV);
 }
 
index 7922914..2322c12 100644 (file)
@@ -1024,7 +1024,6 @@ select_copyout(void *arg, struct kevent *kevp, int count, int *res)
 
                        switch (error) {
                        case EBADF:
-                       case ENODEV:
                                /*
                                 * A bad file descriptor is considered a
                                 * fatal error for select, bail out.
@@ -1041,10 +1040,17 @@ select_copyout(void *arg, struct kevent *kevp, int count, int *res)
                                 * ALWAYS filter out EOPNOTSUPP errors from
                                 * filters (at least until all filters support
                                 * EVFILT_EXCEPT)
+                                *
+                                * We also filter out ENODEV since dev_dkqfilter
+                                * returns ENODEV if EOPNOTSUPP is returned in an
+                                * inner call.
+                                *
+                                * XXX: fix this
                                 */
                                if (kevp[i].filter != EVFILT_READ &&
                                    kevp[i].filter != EVFILT_WRITE &&
-                                   error != EOPNOTSUPP) {
+                                   error != EOPNOTSUPP &&
+                                   error != ENODEV) {
                                        skap->error = error;
                                        *res = -1;
                                        return error;
@@ -1361,10 +1367,17 @@ poll_copyout(void *arg, struct kevent *kevp, int count, int *res)
                                         * from filters, common applications
                                         * set POLLPRI|POLLRDBAND and most
                                         * filters do not support EVFILT_EXCEPT.
+                                        *
+                                        * We also filter out ENODEV since dev_dkqfilter
+                                        * returns ENODEV if EOPNOTSUPP is returned in an
+                                        * inner call.
+                                        *
+                                        * XXX: fix this
                                         */
                                        if (kevp[i].filter != EVFILT_READ &&
                                            kevp[i].filter != EVFILT_WRITE &&
-                                           kevp[i].data != EOPNOTSUPP) {
+                                           kevp[i].data != EOPNOTSUPP &&
+                                           kevp[i].data != ENODEV) {
                                                if (count_res == 0)
                                                        ++*res;
                                                pfd->revents |= POLLERR;