[PATCH v10 6/9] selftests/landlock: add tests for quiet flag with fs rules

Tingmao Wang m at maowtm.org
Mon Jun 8 01:31:03 UTC 2026


On 6/5/26 20:04, Justin Suess wrote:
> On Mon, Jun 01, 2026 at 01:00:40AM +0100, Tingmao Wang wrote:
>> [...]
>> +				if (target->expect_ioctl_allowed)
>> +					ASSERT_NE(EACCES, ret);
>> +				else
>> +					ASSERT_EQ(EACCES, ret);
> This doesn't compile.
> 
>   make: Entering directory '/home/justin/Code/linux-next/tools/testing/selftests'
>     CC       fs_test
>   fs_test.c: In function ‘audit_quiet_layout1_test_body’:
>   fs_test.c:8456:33: error: expected ‘}’ before ‘else’
>    8456 |                                 else
>         |                                 ^~~~
>   fs_test.c: At top level:
>   fs_test.c:8474:1: error: expected identifier or ‘(’ before ‘}’ token
>    8474 | }
>         | ^
>   make[1]: *** [../lib.mk:225: /home/justin/Code/linux-next/.out-landlock_archlinux-base-devel/kselftest/landlock/fs_test] Error 1
>   
> The ASSERT_* macros doen't properly handle braceless if statements...
> 
> (easy to miss if you forget to recompile after clang format and/or
> checkpatch --fix...)
> 
> Adding braces to this as with previous versions of this series should
> fix it.
> 
> Justin

Thanks for spotting!  I forgot and was wondering why I didn't fix this
checkpatch lint earlier, turns out there is a reason why :)

Will fix in next version, after Mickaël's review.



More information about the Linux-security-module-archive mailing list