From patchwork Tue Nov 10 09:52:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ?? X-Patchwork-Id: 7589141 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EF9C7C05C6 for ; Tue, 10 Nov 2015 09:52:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 174EA20646 for ; Tue, 10 Nov 2015 09:52:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C843520650 for ; Tue, 10 Nov 2015 09:52:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752196AbbKJJwp (ORCPT ); Tue, 10 Nov 2015 04:52:45 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:54192 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752052AbbKJJwn (ORCPT ); Tue, 10 Nov 2015 04:52:43 -0500 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NXL01FH6FFSNH50@mailout3.samsung.com> for fstests@vger.kernel.org; Tue, 10 Nov 2015 18:52:40 +0900 (KST) X-AuditID: cbfee61b-f79d56d0000048c5-6d-5641be68455f Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 85.AE.18629.86EB1465; Tue, 10 Nov 2015 18:52:40 +0900 (KST) Received: from yuchao ([109.123.105.89]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NXL00HVGFESNNI0@mmp1.samsung.com>; Tue, 10 Nov 2015 18:52:40 +0900 (KST) From: Chao Yu To: 'Dave Chinner' Cc: fstests@vger.kernel.org Subject: [PATCH] generic/285: fix the wrong result printed in full log Date: Tue, 10 Nov 2015 17:52:03 +0800 Message-id: <01b701d11b9d$89404100$9bc0c300$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AdEbnRe5KfeUCU6FSNGmK5tN4T2utQ== Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrILMWRmVeSWpSXmKPExsVy+t9jAd2MfY5hBrfmmFpsOXaP0eJ0y152 ByaPU4skPD5vkgtgiuKySUnNySxLLdK3S+DKuLfhJVPBUoGK7ddfsjQwNvN0MXJySAiYSJyf uJcRwhaTuHBvPVsXIxeHkMBSRoltX2ZCOa8YJT5MWcoOUsUmoCKxvOM/E4gtIqAhMW3vEeYu Rg4OZgFpibM3wIYKC7hJzF31DKycRUBV4sHDNjCbV8BS4vKVVmYIW1Dix+R7LCA2s4CWxPqd x5kgbHmJzWveMkMcpCCx4+xrRohVehKv//1kh6gRl9h45BbLBEaBWUhGzUIyahaSUbOQtCxg ZFnFKJFakFxQnJSea5SXWq5XnJhbXJqXrpecn7uJERywz6R3MB7e5X6IUYCDUYmHd8I3hzAh 1sSy4srcQ4wSHMxKIrz2L4BCvCmJlVWpRfnxRaU5qcWHGKU5WJTEefU9jcKEBNITS1KzU1ML UotgskwcnFINjCun9KS6vjO/1e6lxhfV98XmqOdlZ01L1gAjzpm7OW9cX7Tj7m+brXkzfr/l lfY5wnaIa3FaW0/fevYDZjcOdv5uTC6Y+C8jRv0Kc+PONf8lFedXqkxw/NexQCa24+5Ce7Y9 /yyM1qx/GHLmjMOqhsApugFH9ocVzFsnzt615IDeDLaps3t7NJVYijMSDbWYi4oTAXAtUB1U AgAA Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This issue was found by testing f2fs module with generic/285, and the related bug has already been fixed since commit 2e023174a88d ("f2fs: avoid data offset overflow when lseeking huge file"), but forgot to fix it in xfstest suit. The wrong result printed is printed in log below: 10. Test a huge file for offset overflow 10.01 SEEK_HOLE expected 65536 or 0, got 65536. succ 10.02 SEEK_HOLE expected 65536 or 0, got 65536. succ 10.03 SEEK_DATA expected 0 or 0, got 0. succ 10.04 SEEK_DATA expected 1 or 1, got 1. succ 10.05 SEEK_HOLE expected 0 or 0, got 0. FAIL 10.06 SEEK_DATA expected -65536 or -65536, got -65536. succ 10.07 SEEK_DATA expected -65535 or -65535, got -65535. succ 10.08 SEEK_DATA expected -65536 or -65536, got -65536. FAIL The result printed in the log shows that when some test cases failed, the data we expected and got are the same that is not correct obviously. The reason is that we cast the result from type off_t(64-bit) to type long(32-bit) when doing huge file offset seeking tests in 32-bit machine. This patch fixes the wrong printing issue. Signed-off-by: Chao Yu --- src/seek_sanity_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/seek_sanity_test.c b/src/seek_sanity_test.c index 7cf45c0..18262c2 100644 --- a/src/seek_sanity_test.c +++ b/src/seek_sanity_test.c @@ -187,10 +187,10 @@ static int do_lseek(int testnum, int subtest, int fd, off_t filsz, int origin, ret = !(errno == ENXIO); } else { - x = fprintf(stdout, "%02d.%02d %s expected %ld or %ld, got %ld. ", + x = fprintf(stdout, "%02d.%02d %s expected %lld or %lld, got %lld. ", testnum, subtest, (origin == SEEK_HOLE) ? "SEEK_HOLE" : "SEEK_DATA", - (long)exp, (long)exp2, (long)pos); + (long long)exp, (long long)exp2, (long long)pos); ret = !(pos == exp || pos == exp2); }