From patchwork Mon Apr 26 14:17:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Hrubis X-Patchwork-Id: 1470327 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FTSB135vpz9sSC for ; Tue, 27 Apr 2021 00:35:53 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 9ABDA3C6747 for ; Mon, 26 Apr 2021 16:35:50 +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 RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 6CCB53C27D7 for ; Mon, 26 Apr 2021 16:35:46 +0200 (CEST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 659D1600A69 for ; Mon, 26 Apr 2021 16:35:46 +0200 (CEST) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D51F6AB87 for ; Mon, 26 Apr 2021 14:35:45 +0000 (UTC) From: Cyril Hrubis To: ltp@lists.linux.it Date: Mon, 26 Apr 2021 16:17:00 +0200 Message-Id: <20210426141700.20036-1-chrubis@suse.cz> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.2 required=7.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-2.smtp.seeweb.it Subject: [LTP] [COMMITTED] [PATCH] syscalls/getdents01: Fix dirp handling 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" After previous fix the test still failed with large enough -i parameter, e.g. -i 10, that was because we incremented the dirp in the run() loop. This patch fixes that by simply using a different pointer for the loop that check the buffer content. Signed-off-by: Cyril Hrubis --- testcases/kernel/syscalls/getdents/getdents01.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/testcases/kernel/syscalls/getdents/getdents01.c b/testcases/kernel/syscalls/getdents/getdents01.c index f36f8869a..e5e4689ee 100644 --- a/testcases/kernel/syscalls/getdents/getdents01.c +++ b/testcases/kernel/syscalls/getdents/getdents01.c @@ -81,16 +81,18 @@ static void run(void) reset_flags(); + void *recp = dirp; + do { - size_t d_reclen = tst_dirp_reclen(dirp); - const char *d_name = tst_dirp_name(dirp); + size_t d_reclen = tst_dirp_reclen(recp); + const char *d_name = tst_dirp_name(recp); set_flag(d_name); tst_res(TINFO, "Found '%s'", d_name); rval -= d_reclen; - dirp += d_reclen; + recp += d_reclen; } while (rval > 0); check_flags();