Linux Test Project
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Avinesh Kumar <akumar@suse.de>
Cc: Lu Fei <lufei@uniontech.com>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] unshare03: use sizeof(long long) to fix for 32bit
Date: Fri, 25 Apr 2025 09:44:35 +0200	[thread overview]
Message-ID: <20250425074435.GA18650@pevik> (raw)
In-Reply-To: <20250424105536.21645-1-akumar@suse.de>

Hi Avinesh, all,

merged, thank you!

> when executing on 32bit compat layer
> "nr_open = sizeof(long) * 8" does not evaluate to a large enough value
> for /proc/sys/fs/nr_open.
> unshare03.c:38: TBROK: Failed to close FILE '/proc/sys/fs/nr_open': EINVAL (22)
> Use (long long) instead.

> Fixes: fc8be6ed4 ("unshare03: Simplify EMFILE test by using fixed fd limit (sizeof(long) * 8)")
> Suggested-by: Petr Vorel <pvorel@suse.cz>
> Signed-off-by: Avinesh Kumar <akumar@suse.de>
> ---
>  testcases/kernel/syscalls/unshare/unshare03.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

> diff --git a/testcases/kernel/syscalls/unshare/unshare03.c b/testcases/kernel/syscalls/unshare/unshare03.c
> index c3b98930d..7128b3b97 100644
> --- a/testcases/kernel/syscalls/unshare/unshare03.c
> +++ b/testcases/kernel/syscalls/unshare/unshare03.c
> @@ -27,7 +27,7 @@ static void run(void)
>  		.exit_signal = SIGCHLD,
>  	};

> -	int nr_open = sizeof(long) * 8;
> +	int nr_open = sizeof(long long) * 8;

>  	SAFE_DUP2(2, nr_open + 1);

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

      parent reply	other threads:[~2025-04-25  7:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-24 10:55 [LTP] [PATCH] unshare03: use sizeof(long long) to fix for 32bit Avinesh Kumar
2025-04-24 11:04 ` Petr Vorel
2025-04-25  7:44 ` Petr Vorel [this message]

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=20250425074435.GA18650@pevik \
    --to=pvorel@suse.cz \
    --cc=akumar@suse.de \
    --cc=ltp@lists.linux.it \
    --cc=lufei@uniontech.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox