Re: [PATCH net v3 6/7] net/sched: act_gate: reject empty schedule list

From: Victor Nogueira

Date: Mon Feb 02 2026 - 07:46:56 EST


On Sat, Jan 31, 2026 at 12:00 PM Paul Moses <p@xxxxxxx> wrote:
>
> Ok, just to confirm the intended behavior changes compared to what is currently in the tree:
>
> create missing entry list FAIL (got -22, expected 0)
> create empty entry list FAIL (got -22, expected 0)
> replace append entries REPLACE append failed: expected 2 entries, got 1
> FAIL (got -22, expected 0)
>
> - CREATE with missing or empty entry list now returns -EINVAL
> Previously, CREATE could appear to succeed if cycle_time was
> provided even with no entries, but it still left an
> empty schedule and later called list_first_entry() at
> net/sched/act_gate.c:552, which is unsafe. Returning -EINVAL here is the
> correct behavior fix.
>
> - REPLACE now replaces the schedule, it does not append
> The old append behavior was an accident caused by reusing the same list and
> never clearing it. With the RCU snapshot change, a fresh schedule is built
> and swapped atomically, so providing a new entry list on REPLACE replaces
> the old one and avoids stale data.
>
> - REPLACE with an empty entry list keeps the old schedule

At first glance it looks ok.
However I can only be sure once you send it and I run some
tests. Just in case I am missing something.

cheers,
Victor