From d918fb909ca8979ea14fb87c3003fe06eca78c06 Mon Sep 17 00:00:00 2001 From: Yxq <3023209091@tju.edu.cn> Date: Mon, 19 Oct 2026 14:21:05 +0800 Subject: [PATCH] samples/bpf: exit with tracex7's status in test_override_return.sh The script checks $? of ./tracex7 correctly, but the else branch only echoes FAILED! - it does not remember the status. The script's last command is 'losetup -d $DEVICE', so the exit status is losetup's (0 on success) and a run whose test failed still reports success. Save $? into rc, use it for the decision, and exit with it after the losetup cleanup (the cleanup still runs). The file is byte-identical to upstream v6.6.119, so this is a drive-by fix of an upstream wart rather than a regression of this tree. Signed-off-by: Yxq <3023209091@tju.edu.cn> --- samples/bpf/test_override_return.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/samples/bpf/test_override_return.sh b/samples/bpf/test_override_return.sh index 35db26f736b9..ac55fcf11004 100755 --- a/samples/bpf/test_override_return.sh +++ b/samples/bpf/test_override_return.sh @@ -7,10 +7,12 @@ DEVICE=$(losetup --show -f testfile.img) mkfs.btrfs -f $DEVICE mkdir tmpmnt ./tracex7 $DEVICE -if [ $? -eq 0 ] +rc=$? +if [ $rc -eq 0 ] then echo "SUCCESS!" else echo "FAILED!" fi losetup -d $DEVICE +exit $rc -- Gitee