All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avinesh Kumar <akumar@suse.de>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] unshare03: use sizeof(long long) to fix for 32bit
Date: Thu, 24 Apr 2025 12:55:34 +0200	[thread overview]
Message-ID: <20250424105536.21645-1-akumar@suse.de> (raw)

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);
 
-- 
2.43.0


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

             reply	other threads:[~2025-04-24 10:55 UTC|newest]

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

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=20250424105536.21645-1-akumar@suse.de \
    --to=akumar@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.