]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Merge branch 'for-6.15-fixes' into for-6.16
authorTejun Heo <tj@kernel.org>
Wed, 7 May 2025 16:25:39 +0000 (06:25 -1000)
committerTejun Heo <tj@kernel.org>
Wed, 7 May 2025 16:25:39 +0000 (06:25 -1000)
To receive 428dc9fc0873 ("sched_ext: bpf_iter_scx_dsq_new() should always
initialize iterator") which conflicts with cdf5a6faa8cf ("sched_ext: Move
dsq_hash into scx_sched"). The conflict is a simple context conflict which
can be resolved by taking changes from both changes in the right order.

1  2 
kernel/sched/ext.c

index 00e18eb072bf83bc9b00e59c3fe655c64a6b5bf9,f5133249fd4d92e362fe032473e4aace7689ef5b..8ccb5c7ff55c974f911e667f88c656ca58f9c6f9
@@@ -6913,10 -6827,12 +6913,16 @@@ __bpf_kfunc int bpf_iter_scx_dsq_new(st
        BUILD_BUG_ON(__alignof__(struct bpf_iter_scx_dsq_kern) !=
                     __alignof__(struct bpf_iter_scx_dsq));
  
+       /*
+        * next() and destroy() will be called regardless of the return value.
+        * Always clear $kit->dsq.
+        */
+       kit->dsq = NULL;
 +      sch = rcu_dereference_check(scx_root, rcu_read_lock_bh_held());
 +      if (!sch)
 +              return -ENODEV;
 +
        if (flags & ~__SCX_DSQ_ITER_USER_FLAGS)
                return -EINVAL;