[LTP] [PATCH] mount03: Convert to new API

Petr Vorel pvorel@suse.cz
Mon Jul 25 10:52:34 CEST 2022


> Hi!
> > @Richie @Li @Metan: There are checkpatch.pl warnings. Yes, kernel folks does not
> > like permission warnings. Do we want to follow? Or should we remove these from
> > our checkpatch.pl fork (we use constants in many places)?

> > $ make check-mount03
> > mount03.c:29: WARNING: Symbolic permissions 'S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH' are not preferred. Consider using octal permissions '0644'.
> > mount03.c:30: WARNING: Symbolic permissions 'S_IRUSR|S_IXUSR|S_IXGRP|S_IXOTH' are not preferred. Consider using octal permissions '0511'.
> > mount03.c:50: WARNING: static char array declaration should probably be static const char
> > mount03.c:103: WARNING: Symbolic permissions 'S_IRWXU' are not preferred. Consider using octal permissions '0700'.
> > mount03.c:114: WARNING: Symbolic permissions 'S_IRWXU' are not preferred. Consider using octal permissions '0700'.
> > mount03.c:125: WARNING: Symbolic permissions 'S_IRWXU' are not preferred. Consider using octal permissions '0700'.
> > mount03.c:181: WARNING: Symbolic permissions 'S_IRWXU' are not preferred. Consider using octal permissions '0700'.
> > mount03.c:204: WARNING: Symbolic permissions 'S_IRWXU' are not preferred. Consider using octal permissions '0700'.

> To be honest I think Linus is right at this one, the single octal number
> is way more readable than the bitwise or of four constants, so I would
> be inclined to start following the kernel practice here.

Agree with the rule, numbers are indeed much readable and I'm for using it in
LTP source.

My concern was different: aren't these constants part of POSIX? See man from
<sys/stat.h> from 1997 [1]. There might be a test for these constants but
it has much lower priority than tests for new kernel functionality and CVE.

Kind regards,
Petr

[1] https://pubs.opengroup.org/onlinepubs/007908799/xsh/sysstat.h.html


More information about the ltp mailing list