[LTP] [PATCH] syscalls/fcntl06: Remove R_GETLK/R_SETLK test case

Yang Xu (Fujitsu) xuyang2018.jy@fujitsu.com
Tue Apr 11 09:04:33 CEST 2023


Hi Petr

> Hi Xu,
> 
>> linux never implement R_GETLK/R_SETLK facility, so this case
>> is useless.
> 
>> A twenty years old email[1] also mentioned that we should remove
>> this case but leave a bad gap number.
> 
>> R_GETLK/R_SETLK facility only exists in the IRIXones.
> 
>> IRIX says this pair of arguments are for use by NFS lockd and really
>> doesn't go into much detail.
> 
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> 
>> Fixes:#1029
>> [1]https://sourceforge.net/p/ltp/mailman/message/7574937/
> ...
>> --- a/testcases/kernel/syscalls/fcntl/fcntl06.c
>> +++ /dev/null
> ...
> 
> - #define F_RGETLK 10                /* kludge code */
> Kernel and glibc/musl does not define F_RGETLK (it's from here),
> and I haven't find find any flag with value 10 in libc include/fcntl.h).
> 
> Commit from 2003 4cf809678 ("*** empty log message ***")
> removed struct flock tl;, therefore it does not compile with
> -DLINUX_FILE_REGION_LOCK.
> With fixed code it shows fcntl() always return -1 and errno EINVAL.
> 
> => looks to be safe to remove the test.

Thanks for your check, merged!

Best Regards
Yang Xu
> 
> Kind regards,
> Petr
> 
>> -#ifdef LINUX_FILE_REGION_LOCK
>> -	if (fcntl(fd, F_RGETLK, &tl) == -1) {
>> -		if (errno == EINVAL)
>> -			tst_brkm(TCONF, cleanup,
>> -				 "fcntl remote locking feature not implemented in "
>> -				 "the kernel");
>> -		else {
>> -			/*
>> -			 * FIXME (garrcoop): having it always pass on
>> -			 * non-EINVAL is a bad test.
>> -			 */
>> -			tst_resm(TPASS, "fcntl on file failed");
>> -		}
>> -	}
> ...


More information about the ltp mailing list