From patchwork Mon Oct 2 17:34:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Liaw X-Patchwork-Id: 1842247 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" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=xvtyiPkk; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; 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 [IPv6:2001:1418:10:5::2]) (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 4Rzp471TPdz20Zd for ; Tue, 3 Oct 2023 04:34:47 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id A2FDA3CE06A for ; Mon, 2 Oct 2023 19:34:44 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id E5E023CDEC1 for ; Mon, 2 Oct 2023 19:34:33 +0200 (CEST) Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 54581600A42 for ; Mon, 2 Oct 2023 19:34:33 +0200 (CEST) Received: by mail-pg1-x54a.google.com with SMTP id 41be03b00d2f7-56c2d67da6aso14793590a12.2 for ; Mon, 02 Oct 2023 10:34:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696268072; x=1696872872; darn=lists.linux.it; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=zuPmbm9QxeLn0RTntL5g5QP6LHXkR4gDzTHhkxw3CFw=; b=xvtyiPkkXbAjHB930r8OsRkDZzTTonRomDWeT/ZT+pF6UHAkohSncNAxvUSfqSkcVh BMuyQuN/zhQMdu5UAvpDp+jKELD1bGrnl5oxN6NjKUjzhwEzvIaUjmCeFBv5v7cnH+iF e/67cNWM7YfDTuhU7bP5UH3lKI+kbe31e8BoQ5zv07jTyyZs0fTWNyrbksvMuRo/AIZn ZdETgYTRQ0C8+iG1Eq7AF37voieB97nwsci91aNuGfZseDUlFcFBFO/YLMZUbTd4k15f 5r77r+mhP/v61fg3Z+7jspyIDwj/rXRvIAh6MeqEy0ZR0H9ykCirq1c+Jz/DRFH7VEdF vXDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696268072; x=1696872872; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zuPmbm9QxeLn0RTntL5g5QP6LHXkR4gDzTHhkxw3CFw=; b=m7LTfB680cz+iAYQOjIYoLr2NtgrkpUnGW71v7PU2EuhpSAFCbyAmPo3cbAuMWvBQt dtFZ2ISm+KLX5Ijo3qoJWrj9Dlq3Z28qIUyGFxYG9bGLxVZDPHNbr9ZiArOE2ClgFTcq zXquv5HxsTkszvRIDiPt3c/sYkFulV23A4dNq5qNRGMgrW5XqmU7NFnBjOGgpYluwTDD BkFFYfhC46zTyZsLeikARRY7D0SUiav9Rz3vo8OgjNqfbJk8T7Wh1zgNNV5u/rfLRDl8 gptQNI4/PilzAJokZ4nopvi+hbspEncaHBoleRbGtOAyjPOjZQ4Li5OtfpU7kg8qpMcd Cgnw== X-Gm-Message-State: AOJu0YzAh3jmRI0eLIhEmPl1A7tnFDFsj242WZpiByTvovvGVKpNq8jX uOQHPg+6UxSMKl2roRQaoFUvlo/qvV05CouqoitVVBqYG3FOMEpIyVolhKKCviv24xTu4rRvpOX BWT4Ng3Pq2XacrbzudApG3rLLjJ+eBMNPqZUQlOpAp63peBeAayOYBjPp X-Google-Smtp-Source: AGHT+IE/DMN12U1BQRa4QqRpxNmKb7HPU8czwK4OW5uYPxVeglkccbVdufiHdp0njGAz9BodrZZ8BZL83I0= X-Received: from edliaw.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:305d]) (user=edliaw job=sendgmr) by 2002:a63:6dc8:0:b0:564:e80e:81c0 with SMTP id i191-20020a636dc8000000b00564e80e81c0mr185437pgc.2.1696268071412; Mon, 02 Oct 2023 10:34:31 -0700 (PDT) Date: Mon, 2 Oct 2023 17:34:15 +0000 In-Reply-To: <20231002173416.1080347-1-edliaw@google.com> Mime-Version: 1.0 References: <20231002173416.1080347-1-edliaw@google.com> X-Mailer: git-send-email 2.42.0.582.g8ccd20d70d-goog Message-ID: <20231002173416.1080347-2-edliaw@google.com> To: ltp@lists.linux.it X-Virus-Scanned: clamav-milter 1.0.1 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-7.4 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH v2 1/2] pipe07: close /proc/self/fd after counting fds 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: , X-Patchwork-Original-From: Edward Liaw via ltp From: Edward Liaw Reply-To: Edward Liaw Cc: kernel-team@android.com Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Leaving the directory fd open will count against the max number of fds opened, so the final expected count will be off when (max_fds - record_open_fds()) is even. Signed-off-by: Edward Liaw --- testcases/kernel/syscalls/pipe/pipe07.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testcases/kernel/syscalls/pipe/pipe07.c b/testcases/kernel/syscalls/pipe/pipe07.c index 196485684..d9b23044d 100644 --- a/testcases/kernel/syscalls/pipe/pipe07.c +++ b/testcases/kernel/syscalls/pipe/pipe07.c @@ -45,6 +45,8 @@ static int record_open_fds(void) opened_fds[num_opened_fds++] = fd; } + SAFE_CLOSEDIR(dir); + return num_opened_fds; }