From patchwork Wed Sep 25 08:49:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 1989261 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=NwK0tFbc; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=patchwork.ozlabs.org) Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XD9Qh71kbz1xt4 for ; Wed, 25 Sep 2024 18:49:46 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 704893C4D64 for ; Wed, 25 Sep 2024 10:49:40 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [IPv6:2001:4b78:1:20::6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 933113C31A5 for ; Wed, 25 Sep 2024 10:49:37 +0200 (CEST) Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.2]) by in-6.smtp.seeweb.it (Postfix) with ESMTP id C4BBC140120C for ; Wed, 25 Sep 2024 10:49:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version; bh=dTHua XzvhYJHqP1atRvIMTJOa9iY4kLjdwGSTJDuqCs=; b=NwK0tFbc/E6WBDFXsn8fj MknTTmyW9hZVd9xRWQ7/bK0qzmolquNuy02awsvpXIpbtmqEet4Oq1hrA+dzxHy6 XLlg7+K58aQMSAyhBktetIFy/++kFQZHGZ9b8U92qaVzdCNg100Ogj5sLSnJkAH5 V4jq1DqjvrjsBQ3rV79SyY= Received: from fedora40.. (unknown [160.86.227.245]) by gzga-smtp-mta-g3-3 (Coremail) with SMTP id _____wDXj1STzvNmwQsWFQ--.51379S2; Wed, 25 Sep 2024 16:49:27 +0800 (CST) From: Xiao Yang To: ltp@lists.linux.it Date: Wed, 25 Sep 2024 17:49:21 +0900 Message-ID: <20240925084921.16352-1-ice_yangxiao@163.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-CM-TRANSID: _____wDXj1STzvNmwQsWFQ--.51379S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7AF1fKr4UKw1xZFyrKr1UGFg_yoW8Zw4rp3 yxtw1Ikw4FqFyrtrW8uanYqay8uwn8Xr15CF4Yyr4Fvr40kFn8Cr4qq3W3JFyUWFW3uayY 93y3Xr4Fyw4Fga7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0JUkfQ_UUUUU= X-Originating-IP: [160.86.227.245] X-CM-SenderInfo: 5lfhs5xdqj5xldr6il2tof0z/1tbiMw1lXmbzzYofGQAAsR X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-6.smtp.seeweb.it X-Virus-Scanned: clamav-milter 1.0.3 at in-6.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH v2] syscalls/{fanotify17, getxattr05}: Fix the ENOSPC error X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" If the value of max_user_namespaces is set to 10 but more than 10 user namspaces are currently used on system. In this case, these tests fail with ENOSPC. for example: # lsns -t user -n | wc -l 17 # ./fanotify17 ... fanotify17.c:174: TINFO: Test #0: Global groups limit in init user ns fanotify17.c:130: TPASS: Created 128 groups - below groups limit (128) fanotify17.c:174: TINFO: Test #1: Global groups limit in privileged user ns fanotify17.c:154: TFAIL: unshare(CLONE_NEWUSER) failed: ENOSPC (28) tst_test.c:452: TBROK: Invalid child (6958) exit value 1 Try to fix the issue by increasing the default value of max_user_namespaces by 10. Signed-off-by: Xiao Yang Reviewed-by: Petr Vorel --- testcases/kernel/syscalls/fanotify/fanotify17.c | 2 +- testcases/kernel/syscalls/getxattr/getxattr05.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/syscalls/fanotify/fanotify17.c b/testcases/kernel/syscalls/fanotify/fanotify17.c index 3ecb31b6e..a6206d953 100644 --- a/testcases/kernel/syscalls/fanotify/fanotify17.c +++ b/testcases/kernel/syscalls/fanotify/fanotify17.c @@ -224,7 +224,7 @@ static void setup(void) user_ns_supported = 0; } else if (!access(MAX_USERNS, F_OK)) { SAFE_FILE_SCANF(MAX_USERNS, "%d", &orig_max_userns); - SAFE_FILE_PRINTF(MAX_USERNS, "%d", 10); + SAFE_FILE_PRINTF(MAX_USERNS, "%d", orig_max_userns + 10); } /* diff --git a/testcases/kernel/syscalls/getxattr/getxattr05.c b/testcases/kernel/syscalls/getxattr/getxattr05.c index d9717a695..f1c8e8391 100644 --- a/testcases/kernel/syscalls/getxattr/getxattr05.c +++ b/testcases/kernel/syscalls/getxattr/getxattr05.c @@ -156,7 +156,7 @@ static void setup(void) user_ns_supported = 0; } else if (!access(MAX_USERNS, F_OK)) { SAFE_FILE_SCANF(MAX_USERNS, "%d", &orig_max_userns); - SAFE_FILE_PRINTF(MAX_USERNS, "%d", 10); + SAFE_FILE_PRINTF(MAX_USERNS, "%d", orig_max_userns + 10); } }