All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Yang Xu <xuyang2018.jy@fujitsu.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] syscalls/fcntl06: Remove R_GETLK/R_SETLK test case
Date: Tue, 11 Apr 2023 08:27:21 +0200	[thread overview]
Message-ID: <20230411062721.GA1737346@pevik> (raw)
In-Reply-To: <1681092133-28614-1-git-send-email-xuyang2018.jy@fujitsu.com>

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.

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");
> -		}
> -	}
...

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2023-04-11  6:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-10  2:02 [LTP] [PATCH] syscalls/fcntl06: Remove R_GETLK/R_SETLK test case Yang Xu
2023-04-11  6:27 ` Petr Vorel [this message]
2023-04-11  7:04   ` Yang Xu (Fujitsu)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230411062721.GA1737346@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=xuyang2018.jy@fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.