On Tue, Apr 29, 2025 at 09:28:50PM +0200, Max Kellermann wrote: > On Tue, Apr 29, 2025 at 9:22 PM Joe Damato <jdamato@xxxxxxxxxx> wrote: > > In commit 0a65bc27bd64 ("eventpoll: Set epoll timeout if it's in the > > future"), a bug was introduced causing the loop in ep_poll to hang under > > certain circumstances. > > > > When the timeout is non-NULL and ep_schedule_timeout returns false, the > > flag timed_out was not set to true. This causes a hang. > > > > Adjust the logic and set timed_out, if needed, fixing the original code. > > Hi Joe, > > we have been working on the fix at the same time, this is my fix: > > https://lore.kernel.org/linux-fsdevel/20250429185827.3564438-1-max.kellermann@xxxxxxxxx/T/#u > > I think mine is better because it checks "eavail" before setting > "timed_out", preserving the old behavior (before commit 0a65bc27bd64). > Your version may set "timed_out" and thus does an unnecessary > list_empty() call in the following block. (And maybe it can reset > "evail" to false?) I think it's up to the maintainers to decide which patch is preferred; I don't really have a preference.