From patchwork Mon May 8 15:12:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Henriques X-Patchwork-Id: 9716393 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B561960364 for ; Mon, 8 May 2017 15:12:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A763F205F6 for ; Mon, 8 May 2017 15:12:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9AA9B23E64; Mon, 8 May 2017 15:12:40 +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=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F1F7205F6 for ; Mon, 8 May 2017 15:12:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755299AbdEHPMh (ORCPT ); Mon, 8 May 2017 11:12:37 -0400 Received: from mx2.suse.de ([195.135.220.15]:52543 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755177AbdEHPMg (ORCPT ); Mon, 8 May 2017 11:12:36 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 87D7DAB1A; Mon, 8 May 2017 15:12:34 +0000 (UTC) Received: from localhost (hermes.olymp [local]) by hermes.olymp (OpenSMTPD) with ESMTPA id a4e26667; Mon, 8 May 2017 15:12:28 +0000 (UTC) From: Luis Henriques To: Eryu Guan Cc: "Yan, Zheng" , fstests@vger.kernel.org, ceph-devel@vger.kernel.org, Luis Henriques Subject: [PATCH v2] src/seek_sanity_test: ensure file size is big enough Date: Mon, 8 May 2017 16:12:27 +0100 Message-Id: <20170508151227.16881-1-lhenriques@suse.com> In-Reply-To: <20170508104728.GW7250@eguan.usersys.redhat.com> References: <20170508104728.GW7250@eguan.usersys.redhat.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Tests test07, test08, and test09 preallocate a file and assume the file size used is bigger than 10xbufsz (100xbufsz for test09). This patch adjusts the file size so this assumption is always true. As an example, here's test07 output for cephfs, where the allocation size is set to 4194304, and the output is (4194304 * 10 + 4194304) 07. Test file with unwritten extents, only have dirty pages 07.01 SEEK_HOLE expected 0 or 4194304, got 46137344. FAIL 07.02 SEEK_HOLE expected 1 or 4194304, got 46137344. FAIL Signed-off-by: Luis Henriques --- changes since v1: - Adjust max file size directly instead of looping - Drop integer overflow test - Updated changelog src/seek_sanity_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/src/seek_sanity_test.c b/src/seek_sanity_test.c index a6dd48cc257b..0f5c22e7f450 100644 --- a/src/seek_sanity_test.c +++ b/src/seek_sanity_test.c @@ -280,7 +280,7 @@ static int test09(int fd, int testnum) int ret = 0; char *buf = NULL; int bufsz = alloc_size; - int filsz = 8 << 20; + int filsz = bufsz * 100 + bufsz; /* * HOLE - unwritten DATA in dirty page - HOLE - @@ -336,7 +336,7 @@ static int test08(int fd, int testnum) int ret = 0; char *buf = NULL; int bufsz = alloc_size; - int filsz = 4 << 20; + int filsz = bufsz * 10 + bufsz; /* HOLE - unwritten DATA in writeback page */ /* Each unit is bufsz */ @@ -385,7 +385,7 @@ static int test07(int fd, int testnum) int ret = 0; char *buf = NULL; int bufsz = alloc_size; - int filsz = 4 << 20; + int filsz = bufsz * 10 + bufsz; /* HOLE - unwritten DATA in dirty page */ /* Each unit is bufsz */