From patchwork Tue May 23 08:02:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 9742039 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 52E1A6032B for ; Tue, 23 May 2017 08:02:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44F521FF29 for ; Tue, 23 May 2017 08:02:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39400286B5; Tue, 23 May 2017 08:02: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 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 D3D481FF29 for ; Tue, 23 May 2017 08:02:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762283AbdEWICh (ORCPT ); Tue, 23 May 2017 04:02:37 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:34931 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1759927AbdEWICT (ORCPT ); Tue, 23 May 2017 04:02:19 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="19194999" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 23 May 2017 16:02:13 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id D98F047C653F; Tue, 23 May 2017 16:02:07 +0800 (CST) Received: from localhost.localdomain (10.167.226.34) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 23 May 2017 16:02:06 +0800 From: Qu Wenruo To: , Subject: [PATCH] fstests: common: Make _test_mount to include MOUNT_OPTIONS to allow consistent _test_cycle_mount Date: Tue, 23 May 2017 16:02:05 +0800 Message-ID: <20170523080205.12556-1-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.13.0 MIME-Version: 1.0 X-Originating-IP: [10.167.226.34] X-yoursite-MailScanner-ID: D98F047C653F.A0B89 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: quwenruo@cn.fujitsu.com Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP [BUG] If using MOUNT_OPTIONS="-o nodatasum" and btrfs to run genierc/142 generic/143 and generic/154, it will cause false alert like: cp: failed to clone '/mnt/test/test-154/file2' from '/mnt/test/test-154/file1': Invalid argument [REASON] It is caused by _test_cycle_mount function, which unmount test device, but when trying to re-mount it again using _test_mount(), we don't pass $MOUNT_OPTIONS. So this makes mount options differs between _test_cycle_mount(). And btrfs doesn't allow different csum flags between reflink source and destination inodes, so it returns -EINVAL for reflink operation. [FIX] Fix it by passing $MOUNT_OPTIONS to _test_mount(), so that _test_cycle_mount() won't cause different mount options. So btrfs with "-o nodatasum" mount option can pass generic/14[23] and generic/154 without false alert. Signed-off-by: Qu Wenruo --- common/rc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/rc b/common/rc index ba215961..a591907c 100644 --- a/common/rc +++ b/common/rc @@ -522,7 +522,8 @@ _test_mount() return $? fi _test_options mount - _mount -t $FSTYP $TEST_OPTIONS $TEST_FS_MOUNT_OPTS $SELINUX_MOUNT_OPTIONS $* $TEST_DEV $TEST_DIR + _mount -t $FSTYP $TEST_OPTIONS $TEST_FS_MOUNT_OPTS $SELINUX_MOUNT_OPTIONS \ + $MOUNT_OPTIONS $* $TEST_DEV $TEST_DIR } _test_unmount()