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: 151074 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5679758ljp; Wed, 14 Nov 2018 05:21:10 -0800 (PST) X-Google-Smtp-Source: AJdET5cGOQjyyYBURGUqeh6EmJnWc92GXTua2FWJAJmUb5qLlnquSu+19ftVW891KcJRvotl1MwZ X-Received: by 2002:a37:3388:: with SMTP id z130mr1532857qkz.51.1542201670881; Wed, 14 Nov 2018 05:21:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542201670; cv=none; d=google.com; s=arc-20160816; b=GEIlbW7dDYnFmKa6YLKd1nIYg1qgNk5PUukgBB1SdVJUzFQsAjwWRQ2IMMjuU5THYM XF0kMVZUZzOwtkNw79LkhofYcKxHdS/7P+jUyQTU+7w+C8OvwbwPTtD5Kc1XEBrIEwZC 42Sov31qbYpd1AsYVUUQQEeebyFWjnkOg33O+wIVK2qlORFhe15z/Eg4cXa8iylC61RI +kmL+CF5Dv1badCoHESDW2Bq0jkTc/bK7eAV36lUU0jHeOHfigvvjgfsgG4hGDxDFcsY i0wNk0NsytGJ57MhNnG15jUv+jplM4d7SGGru6+yAIByqX2wW7RxI7T8JKo/PugD9Qwk PNcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=6Fwb/i4a4kLsiCRQBPO8royHU2RPXH8jxBjwV4ssIfc=; b=Ysq+O0Z9u5lerqF91w/idqz/G7JjuUS8e6TLDZawfG18mDGi9y8kNFCfOqRwiXYmQ+ JO91+WzBiLLdHB/TTBav/6FN5m+plzSIh12joA9QWuwM+IlS8z/p7XFVkKPsZmVFQDbN 3Gt/x/QhrBtZRH7AoKgdoK+p79tnljOnffMj1Kylx9+JtV9jdkbMeVKHvmb0bvUucZY3 UqSL/FCR5I6ErEnX0sMHDFXFRBYXgGEdsDczomZ225Ho5OgwYfuo8To5lGWX9UCVixzM oDVIXHx1JmCZujC5TgCAEwTatcZ0pSGDjuJEMiJwm9wqVKjwFbkMH+75/m/UCM7ztbWm u8bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hCA7C27G; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id a76si1822946qka.92.2018.11.14.05.21.10 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 14 Nov 2018 05:21:10 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hCA7C27G; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMv6T-00022M-KY for patch@linaro.org; Wed, 14 Nov 2018 08:21:09 -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-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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 -- 2.17.1 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 &&