More comments
diff --git a/src/core/lib/iomgr/ev_epoll1_linux.cc b/src/core/lib/iomgr/ev_epoll1_linux.cc
index 1c495b4..5545225 100644
--- a/src/core/lib/iomgr/ev_epoll1_linux.cc
+++ b/src/core/lib/iomgr/ev_epoll1_linux.cc
@@ -311,7 +311,9 @@
ev.events = static_cast<uint32_t>(EPOLLIN | EPOLLOUT | EPOLLET);
/* Use the least significant bit of ev.data.ptr to store track_err. We expect
* the addresses to be word aligned. We need to store track_err to avoid
- * synchronization issues when accessing it after receiving an event. */
+ * synchronization issues when accessing it after receiving an event.
+ * Accessing fd would be a data race there because the fd might have been
+ * returned to the free list at that point. */
ev.data.ptr = reinterpret_cast<void*>(reinterpret_cast<intptr_t>(new_fd) |
(track_err ? 1 : 0));
if (epoll_ctl(g_epoll_set.epfd, EPOLL_CTL_ADD, fd, &ev) != 0) {
diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc
index 22b13d0..be400c6 100644
--- a/src/core/lib/iomgr/ev_epollex_linux.cc
+++ b/src/core/lib/iomgr/ev_epollex_linux.cc
@@ -594,7 +594,8 @@
static_cast<uint32_t>(EPOLLET | EPOLLIN | EPOLLOUT | EPOLLEXCLUSIVE);
/* Use the second least significant bit of ev_fd.data.ptr to store track_err
* to avoid synchronization issues when accessing it after receiving an event.
- */
+ * Accessing fd would be a data race there because the fd might have been
+ * returned to the free list at that point. */
ev_fd.data.ptr = reinterpret_cast<void*>(reinterpret_cast<intptr_t>(fd) |
(fd->track_err ? 2 : 0));
GRPC_STATS_INC_SYSCALL_EPOLL_CTL();