From patchwork Wed Nov 14 13:10:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 10682607 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 00439109C for ; Wed, 14 Nov 2018 13:19:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E688B2858B for ; Wed, 14 Nov 2018 13:19:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA5342AD51; Wed, 14 Nov 2018 13:19:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7C1772858B for ; Wed, 14 Nov 2018 13:19:34 +0000 (UTC) Received: from localhost ([::1]:60156 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMv4v-0000lc-5N for patchwork-qemu-devel@patchwork.kernel.org; Wed, 14 Nov 2018 08:19:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMuvu-0001K9-PU for qemu-devel@nongnu.org; Wed, 14 Nov 2018 08:10:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMuvs-0004I0-KQ for qemu-devel@nongnu.org; Wed, 14 Nov 2018 08:10:14 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:52557) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gMuvs-0004H2-Ed for qemu-devel@nongnu.org; Wed, 14 Nov 2018 08:10:12 -0500 Received: by mail-wm1-x335.google.com with SMTP id r11-v6so15354988wmb.2 for ; Wed, 14 Nov 2018 05:10:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6Fwb/i4a4kLsiCRQBPO8royHU2RPXH8jxBjwV4ssIfc=; b=hCA7C27GZoVOjf11/0wBg+vZ6ngJBaVgcUupA728e/fIzovc5uhuvVgAPurKVcNVF+ a4K+hnVX0n5Q3dYhj6IKUHYbYI380mQyI4Qhp6B0aT5dmhADCibluN/15s3eViMz9RE3 9dMSAUam2VCJNamnDM4R7a3wr0zzgjwBxozU0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6Fwb/i4a4kLsiCRQBPO8royHU2RPXH8jxBjwV4ssIfc=; b=ZrrvV6P8peuD6UGsdTP4FIRrZTCE+RnN+jIiDSuXKsfd7RCZQayHEXIo3TGTWUF9m1 vRTc8jT/R4kwEvHCpJ3zaKGrAAskilXr+fEwOaX+0vBEOKzZV5bsPpXSkGgzlbNrfbs7 s4uaKOR/xhbamWIIuwZOLa32mFIIJ2S/YNE4I4slvVOwguwLt9ZlDO9bpShwVdDLPlg0 AmNlnEwdFaIeAeS577BK1Tnhv/snS4XN8ncP/DX8y9KjQhbBhNblTUz4ZL8nKcQAxfg6 7H39WHMgUtIHP3nmZ0qtxExychUSCfK6rHK60uyExszgK675wqtT+rVKOC6EYnGhfO3g 2agw== X-Gm-Message-State: AGRZ1gK0YiVKV3KQgk+pW1A/FqphtoXfw7+MjOfCmj7jtZHQX/AyPPxm ovG1rVlKjCfk8XbEvLFpzky+SQ== X-Google-Smtp-Source: AJdET5e27OrXXpLbQhcvEeYCyxqa/xnWqRJzV3E/oh4YDg0QudLGUB+KPRbn8IuFb2geKlc/YEA5jQ== X-Received: by 2002:a1c:9ce:: with SMTP id 197-v6mr1956635wmj.51.1542201011196; Wed, 14 Nov 2018 05:10:11 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id e14-v6sm14657275wrv.93.2018.11.14.05.10.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Nov 2018 05:10:09 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id E03303E02B6; Wed, 14 Nov 2018 13:10:08 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Wed, 14 Nov 2018 13:10:08 +0000 Message-Id: <20181114131008.27599-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181114131008.27599-1-alex.bennee@linaro.org> References: <20181114131008.27599-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::335 Subject: [Qemu-devel] [PULL 2/2] tests/tcg/multiarch: fix 32bit linux-test on 64bit host X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Laurent Vivier Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Laurent Vivier Fix: TEST linux-test on i386 .../tests/tcg/multiarch/linux-test.c:201: readdir readdir() calls getdents64() to have the list of the entries in a directory, and getdents64() can return 64bit d_off values (with ext4, for instance) that will not fit in the 32bit d_off field of the readdir() dirent structure. To avoid that, use readdir64() to use a 64bit d_off field too. Signed-off-by: Laurent Vivier Signed-off-by: Alex Bennée diff --git a/tests/tcg/multiarch/linux-test.c b/tests/tcg/multiarch/linux-test.c index e80eccc0ce..fa4243fc04 100644 --- a/tests/tcg/multiarch/linux-test.c +++ b/tests/tcg/multiarch/linux-test.c @@ -83,7 +83,7 @@ static void test_file(void) struct utimbuf tbuf; struct iovec vecs[2]; DIR *dir; - struct dirent *de; + struct dirent64 *de; /* TODO: make common tempdir creation for tcg tests */ char template[] = "/tmp/linux-test-XXXXXX"; char *tmpdir = mkdtemp(template); @@ -186,7 +186,7 @@ static void test_file(void) error("opendir"); len = 0; for(;;) { - de = readdir(dir); + de = readdir64(dir); if (!de) break; if (strcmp(de->d_name, ".") != 0 &&