From patchwork Thu May 26 03:26:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 9136541 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 CFC496075C for ; Thu, 26 May 2016 03:26:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C415226E82 for ; Thu, 26 May 2016 03:26:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6781282B3; Thu, 26 May 2016 03:26:49 +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 6257E26E82 for ; Thu, 26 May 2016 03:26:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752974AbcEZD0t (ORCPT ); Wed, 25 May 2016 23:26:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42145 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752770AbcEZD0s (ORCPT ); Wed, 25 May 2016 23:26:48 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E97A37DCD7; Thu, 26 May 2016 03:26:47 +0000 (UTC) Received: from localhost (dhcp-12-144.nay.redhat.com [10.66.12.144]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4Q3QkGS003411; Wed, 25 May 2016 23:26:47 -0400 From: Eryu Guan To: fstests@vger.kernel.org Cc: linux-ext4@vger.kernel.org, Eryu Guan Subject: [PATCH v2] generic/250: ignore xfs_io IO errors when writing to dmerror device Date: Thu, 26 May 2016 11:26:24 +0800 Message-Id: <1464233184-24013-1-git-send-email-eguan@redhat.com> In-Reply-To: <1464096276-28407-1-git-send-email-eguan@redhat.com> References: <1464096276-28407-1-git-send-email-eguan@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 26 May 2016 03:26:47 +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 When testing with data=journal ext4, direct write to dmerror device doesn't return EIO, because ext4 turns direct write to buffered write in data=journal mode and all data is written to journal buffer. The write only fails later when commiting journal and error messages can be seen in dmesg. As the test is checking on the md5 checksum of the test file, it's ok to ignore the IO error returned by xfs_io, as long as the checksums match the golden image. Signed-off-by: Eryu Guan Reviewed-by: Darrick J. Wong --- v2: - Replace "CoW" with "Write" and update .out accordingly tests/generic/250 | 5 +++-- tests/generic/250.out | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/generic/250 b/tests/generic/250 index 6d15de2..3c4fe6d 100755 --- a/tests/generic/250 +++ b/tests/generic/250 @@ -79,11 +79,12 @@ _dmerror_mount echo "Compare files" md5sum $testdir/file2 | _filter_scratch -echo "CoW and unmount" +echo "Write and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full sync _dmerror_load_error_table -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ + >> $seqres.full 2>&1 _dmerror_load_working_table _dmerror_unmount _dmerror_mount diff --git a/tests/generic/250.out b/tests/generic/250.out index 710c80e..67b006b 100644 --- a/tests/generic/250.out +++ b/tests/generic/250.out @@ -3,8 +3,7 @@ Format and mount Create the original files Compare files ec8bb3b24d5b0f1b5bdf8c8f0f541ee6 SCRATCH_MNT/test-250/file2 -CoW and unmount -pwrite64: Input/output error +Write and unmount Compare files 3ed86318f4ff8da26c1c2a6e3041f9be SCRATCH_MNT/test-250/file2 Check for damage