taskstats: fix struct taskstats breaks backward compatibility since version 15
authorWang Yaxin <wang.yaxin@zte.com.cn>
Sat, 10 May 2025 07:54:13 +0000 (15:54 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 21 May 2025 05:49:39 +0000 (22:49 -0700)
commit0bf2d838de1ffb6d0bb6f8d18a6ccc59b7d9a705
treeb0e251fc0f49c763f3e779d349d5e1e9c5928348
parent66f28ffb38ccc9d7e5fc8066d4c6aab6434f94a4
taskstats: fix struct taskstats breaks backward compatibility since version 15

Problem
========
commit 658eb5ab916d ("delayacct: add delay max to record delay peak")
  - adding more fields
commit f65c64f311ee ("delayacct: add delay min to record delay peak")
  - adding more fields
commit b016d0873777 ("taskstats: modify taskstats version")
 - version bump to 15

Since version 15 (TASKSTATS_VERSION=15) the new layout of the structure
adds fields in the middle of the structure, rendering all old software
incompatible with newer kernels and software compiled against the new
kernel headers incompatible with older kernels.

Solution
=========
move delay max and delay min to the end of taskstat, and bump
the version to 16 after the change

[wang.yaxin@zte.com.cn: adjust indentation]
Link: https://lkml.kernel.org/r/202505192131489882NSciXV4EGd8zzjLuwoOK@zte.com.cn
Link: https://lkml.kernel.org/r/20250510155413259V4JNRXxukdDgzsaL0Fo6a@zte.com.cn
Fixes: f65c64f311ee ("delayacct: add delay min to record delay peak")
Signed-off-by: Wang Yaxin <wang.yaxin@zte.com.cn>
Signed-off-by: xu xin <xu.xin16@zte.com.cn>
Signed-off-by: Kun Jiang <jiang.kun2@zte.com.cn>
Reviewed-by: Yang Yang <yang.yang29@zte.com.cn>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/uapi/linux/taskstats.h