public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Alexander Aring <aahringo@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 2/5] fcntl41: test for owner values on OFD posix locks
Date: Wed, 21 Jun 2023 11:38:28 +0200	[thread overview]
Message-ID: <20230621093828.GA386889@pevik> (raw)
In-Reply-To: <20230530203707.2965684-3-aahringo@redhat.com>

Hi Alexander,

> diff --git a/testcases/kernel/syscalls/fcntl/fcntl41.c b/testcases/kernel/syscalls/fcntl/fcntl41.c
> new file mode 100644
> index 000000000..40d14ff02
> --- /dev/null
> +++ b/testcases/kernel/syscalls/fcntl/fcntl41.c
...
> +#include <sys/wait.h>
> +
> +#include "tst_test.h"
> +
> +static int fd, fd2;
> +
> +void do_child1(void)
> +{
> +	const struct flock fl_0_0 = {
> +		.l_type = F_WRLCK,
> +		.l_whence = SEEK_SET,
> +		.l_start = 0L,
> +		.l_len = 1L,
> +	};
> +
> +	tst_res(TINFO, "thread1 waits for thread2 to lock 1-1");
> +	TST_CHECKPOINT_WAIT(1);
> +
> +	tst_res(TINFO, "thread1 lock region 0-0 - It should block");
> +	SAFE_FCNTL(fd2, F_OFD_SETLKW, &fl_0_0);
F_OFD_SETLKW is undefined on old Cent0S 7, we still support:
https://github.com/pevik/ltp/actions/runs/5331934790/jobs/9660442246

You need to use our fallback to avoid this.

#include "lapi/fcntl.h"

We also have fcntl_common.h, which is used for F_OFD_* (fcntl_compat(),
you may need to use it. It also includes lapi/fcntl.h.

Kind regards,
Petr

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

  reply	other threads:[~2023-06-21  9:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-30 20:37 [LTP] [PATCH 0/5] fcntl: add more testcases Alexander Aring
2023-05-30 20:37 ` [LTP] [PATCH 1/5] fcntl40: test for owner values on classic posix lock Alexander Aring
2023-06-21  9:03   ` Petr Vorel
2023-06-30 19:59     ` Alexander Aring
2023-07-02 19:18       ` Petr Vorel
2023-07-05 13:23         ` Alexander Aring
2023-07-07  8:14           ` Petr Vorel
2023-07-07 12:50             ` Alexander Aring
2023-07-07 13:17               ` Petr Vorel
2023-07-02 19:19       ` Petr Vorel
2023-05-30 20:37 ` [LTP] [PATCH 2/5] fcntl41: test for owner values on OFD posix locks Alexander Aring
2023-06-21  9:38   ` Petr Vorel [this message]
2023-06-30 20:00     ` Alexander Aring
2023-05-30 20:37 ` [LTP] [PATCH 3/5] fcntl42: test for F_SETLKW interruption case Alexander Aring
2023-05-30 20:37 ` [LTP] [PATCH 4/5] fcntl43: test for identical F_SETLKW lock requests Alexander Aring
2023-05-30 20:37 ` [LTP] [PATCH 5/5] fcntl44: test for kill child while others waiting Alexander Aring

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=20230621093828.GA386889@pevik \
    --to=pvorel@suse.cz \
    --cc=aahringo@redhat.com \
    --cc=ltp@lists.linux.it \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox