about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2014-09-05 19:04:31 +0000
committerEric Wong <e@80x24.org>2014-09-05 19:04:31 +0000
commit5087825f3fd0ad59ce7afedaaaaa17d16196e1f6 (patch)
tree988ccd290b74e843bc6ca4b52e3f031a79c4b204
parente734132c6710451340e04a765fd08f60b6102771 (diff)
downloadcmogstored-5087825f3fd0ad59ce7afedaaaaa17d16196e1f6.tar.gz
commit 356ad39592cfcb537a512b2f88ed44380ae5cd78
("epoll: prevent missed events on EPOLL_CTL_MOD")
in the 2.6.34 stable tree
-rw-r--r--queue_epoll.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/queue_epoll.c b/queue_epoll.c
index 4112377..90d0d89 100644
--- a/queue_epoll.c
+++ b/queue_epoll.c
@@ -55,11 +55,20 @@ __attribute__((constructor)) static void epoll_ctl_mod_buggy_detect(void)
         if (version <= 2)
                 epoll_ctl_mod_buggy = true;
 
-        /* 2.6.32.61 is OK */
-        if (version == 2 && patchlevel == 6 && sublevel == 32) {
+        /* 2.6.32.61+ and 2.6.34.15+ are OK */
+        if (version == 2 && patchlevel == 6 &&
+            (sublevel == 32 || sublevel == 34)) {
                 rc = sscanf(buf.release, "%u.%u.%u.%u",
                             &version, &patchlevel, &sublevel, &extra);
-                epoll_ctl_mod_buggy = (rc == 4) && (extra < 61);
+                if (rc != 4)
+                        return;
+
+                if (sublevel == 32)
+                        epoll_ctl_mod_buggy = extra < 61; /* 2.6.32.61+ */
+                else if (sublevel == 34)
+                        epoll_ctl_mod_buggy = extra < 15; /* 2.6.34.15+ */
+                else
+                        assert("buggy version check for 2.6.32.61/2.6.34.15");
         }
 
         if (version != 3)