From patchwork Wed Mar 2 22:25:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Zwisler X-Patchwork-Id: 8486391 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 50E56C0553 for ; Wed, 2 Mar 2016 22:26:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6F6AB2024C for ; Wed, 2 Mar 2016 22:26:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1D38E201FE for ; Wed, 2 Mar 2016 22:26:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754087AbcCBW0R (ORCPT ); Wed, 2 Mar 2016 17:26:17 -0500 Received: from mga01.intel.com ([192.55.52.88]:17245 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751004AbcCBW0R (ORCPT ); Wed, 2 Mar 2016 17:26:17 -0500 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 02 Mar 2016 14:26:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,530,1449561600"; d="scan'208";a="757012828" Received: from rzwisler-desk.amr.corp.intel.com (HELO phyrexia.intel.com) ([10.254.47.10]) by orsmga003.jf.intel.com with ESMTP; 02 Mar 2016 14:26:15 -0800 From: Ross Zwisler To: fstests@vger.kernel.org Cc: Ross Zwisler , Dave Chinner , Jan Kara Subject: [PATCH] defrag: ext4 defrag not supported with DAX Date: Wed, 2 Mar 2016 15:25:52 -0700 Message-Id: <1456957552-25326-1-git-send-email-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.5.0 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-6.9 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 As of this kernel commit: commit 73f34a5e2ced ("ext4: online defrag not supported with DAX") online defrag operations for ext4 are disallowed when the filesystem is mounted with the DAX option. This causes several xfstests to fail because they expect the defrag operation to change the file layout: ext4/308 [failed, exit status 1] - output mismatch (see /root/xfstests/results//ext4/308.out.bad) --- tests/ext4/308.out 2015-10-02 10:19:36.791795792 -0600 +++ /root/xfstests/results//ext4/308.out.bad 2016-02-17 16:20:52.330454602 -0700 @@ -23,659 +23,5 @@ 50f924a5dc9b03609a4577f9f961414b SCRATCH_MNT/test.10 Perform compacting 50f924a5dc9b03609a4577f9f961414b SCRATCH_MNT/test.10 -Perform compacting, second pass -50f924a5dc9b03609a4577f9f961414b SCRATCH_MNT/test.10 -Create file with 20 * 2 fragments -wrote 1234/1234 bytes at offset 0 ... (Run 'diff -u tests/ext4/308.out /root/xfstests/results//ext4/308.out.bad' to see the entire diff) generic/018 1s ... [failed, exit status 1] - output mismatch (see /root/xfstests/results//generic/018.out.bad) --- tests/generic/018.out 2016-02-17 16:02:40.103656140 -0700 +++ /root/xfstests/results//generic/018.out.bad 2016-02-17 16:20:53.117459173 -0700 @@ -10,10 +10,6 @@ After: 1 Write backwards sync, but contiguous - should defrag to 1 extent Before: in_range(5, 10) -After: 1 -Write backwards sync leaving holes - defrag should do nothing -Before: 16 -After: 16 ... (Run 'diff -u tests/generic/018.out /root/xfstests/results//generic/018.out.bad' to see the entire diff) Avoid this by skipping over defrag tests if we are using ext4 + DAX. Signed-off-by: Ross Zwisler --- common/defrag | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/defrag b/common/defrag index d2b137e..1c970e2 100644 --- a/common/defrag +++ b/common/defrag @@ -27,7 +27,12 @@ _require_defrag() DEFRAG_PROG="$XFS_FSR_PROG" ;; ext4|ext4dev) - DEFRAG_PROG="$E4DEFRAG_PROG" + echo $MOUNT_OPTIONS | grep -q dax + if [ $? -eq 0 ]; then + _notrun "defragmentation not supported with DAX" + else + DEFRAG_PROG="$E4DEFRAG_PROG" + fi ;; btrfs) DEFRAG_PROG="$BTRFS_UTIL_PROG filesystem defragment"