All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3 03/10] Rewrite sem_comm.c using new LTP API
Date: Thu, 24 Mar 2022 16:04:59 +0100	[thread overview]
Message-ID: <YjyImxbSuv6QZ6ep@yuki> (raw)
In-Reply-To: <20220315103254.7185-4-andrea.cervesato@suse.de>

Hi!
> +	TEST(semop(id, &sm, 1));
> +	if (TST_RET < 0) {
> +		if (TST_ERR != EAGAIN)
> +			tst_brk(TBROK | TERRNO, "semop error");
> +
> +		tst_res(TFAIL, "can't lock semaphore between namespaces");

The message is very confusing here. If we get here the semaphone was
locked by the other child in a different namespace. We should print
something as "semaphore decremented from different namespace"

> +	} else {
> +		tst_res(TPASS, "locked semaphore between namespaces");

Here as well, confusing message.

>  	}
>  
>  	/* tell child1 to continue */
> -	TST_SAFE_CHECKPOINT_WAKE(NULL, 0);
> +	TST_CHECKPOINT_WAKE(0);
>  
>  	sm.sem_op = 1;
> -	semop(id, &sm, 1);
> +	SAFE_SEMOP(id, &sm, 1);

I wonder if it's necessary to modify the semaphore value before the
RMDID here. Can't we just remove it instead?

> +	SAFE_SEMCTL(id, 0, IPC_RMID);

-- 
Cyril Hrubis
chrubis@suse.cz

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

  reply	other threads:[~2022-03-24 15:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15 10:32 [LTP] [PATCH v3 00/10] Rewrite sysvipc testing suite using new LTP API Andrea Cervesato
2022-03-15 10:32 ` [LTP] [PATCH v3 01/10] Rewrite mesgq_nstest.c " Andrea Cervesato
2022-03-24 14:25   ` Cyril Hrubis
2022-03-15 10:32 ` [LTP] [PATCH v3 02/10] Rewrite msg_comm.c " Andrea Cervesato
2022-03-24 14:39   ` Cyril Hrubis
2022-03-15 10:32 ` [LTP] [PATCH v3 03/10] Rewrite sem_comm.c " Andrea Cervesato
2022-03-24 15:04   ` Cyril Hrubis [this message]
2022-03-15 10:32 ` [LTP] [PATCH v3 04/10] Rewrite sem_nstest.c " Andrea Cervesato
2022-03-24 15:12   ` Cyril Hrubis
2022-03-15 10:32 ` [LTP] [PATCH v3 05/10] Rewrite semtest_2ns.c " Andrea Cervesato
2022-03-24 16:04   ` Cyril Hrubis
2022-03-15 10:32 ` [LTP] [PATCH v3 06/10] Rewrite shmnstest.c " Andrea Cervesato
2022-03-24 16:10   ` Cyril Hrubis
2022-03-15 10:32 ` [LTP] [PATCH v3 07/10] Rewrite shmem_2nstest.c " Andrea Cervesato
2022-03-24 16:14   ` Cyril Hrubis
2022-03-15 10:32 ` [LTP] [PATCH v3 08/10] Rewrite shm_comm.c " Andrea Cervesato
2022-03-15 10:32 ` [LTP] [PATCH v3 09/10] Remove libclone dependency from sysvipc test suite Andrea Cervesato
2022-03-15 10:32 ` [LTP] [PATCH v3 10/10] Delete ipcns_helper.h in the " Andrea Cervesato

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=YjyImxbSuv6QZ6ep@yuki \
    --to=chrubis@suse.cz \
    --cc=andrea.cervesato@suse.de \
    --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 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.