From patchwork Sat Nov 18 06:19:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 10064385 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 BD49960352 for ; Sat, 18 Nov 2017 06:19:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0FD92AE91 for ; Sat, 18 Nov 2017 06:19:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 942292AE9C; Sat, 18 Nov 2017 06:19:13 +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 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 39DCA2AE91 for ; Sat, 18 Nov 2017 06:19:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161739AbdKRGTL (ORCPT ); Sat, 18 Nov 2017 01:19:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42590 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161737AbdKRGTL (ORCPT ); Sat, 18 Nov 2017 01:19:11 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1EE89883AB for ; Sat, 18 Nov 2017 06:19:11 +0000 (UTC) Received: from localhost (dhcp-12-147.nay.redhat.com [10.66.12.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9B7C76024D; Sat, 18 Nov 2017 06:19:10 +0000 (UTC) From: Eryu Guan To: fstests@vger.kernel.org Cc: Eryu Guan Subject: [PATCH] ltp/fsx: really skip fallocate keep_size calls when replaying ops Date: Sat, 18 Nov 2017 14:19:06 +0800 Message-Id: <20171118061906.11227-1-eguan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sat, 18 Nov 2017 06:19:11 +0000 (UTC) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On start up, fsx checks for various fallocate(2) operation support status and disables unsupported operations. But when replaying operations from a log, fsx failed to skip KEEP_SIZE fallocate(2) calls if underlying filesystem doesn't support it. For example, NFSv4.2 supports fallocate(2) but not KEEP_SIZE, and this causes generic/469 fails on NFSv4.2. Fix it by taking 'keep_size_calls' into consideration when replaying ops from log file. Signed-off-by: Eryu Guan --- Note that generic/469 hasn't been pushed to upstream yet. Will do in this week's update. ltp/fsx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ltp/fsx.c b/ltp/fsx.c index 9c358f27bd92..fc1381e60f09 100644 --- a/ltp/fsx.c +++ b/ltp/fsx.c @@ -1469,7 +1469,7 @@ test(void) offset = log_entry.args[0]; size = log_entry.args[1]; closeopen = !!(log_entry.flags & FL_CLOSE_OPEN); - keep_size = !!(log_entry.flags & FL_KEEP_SIZE); + keep_size = !!((log_entry.flags & FL_KEEP_SIZE) && keep_size_calls); goto have_op; } return 0;