From patchwork Fri Feb 27 01:23:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaegeuk Kim X-Patchwork-Id: 5897311 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 D2DAFBF440 for ; Fri, 27 Feb 2015 01:24:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0607920220 for ; Fri, 27 Feb 2015 01:24:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 129502022D for ; Fri, 27 Feb 2015 01:24:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753430AbbB0BYJ (ORCPT ); Thu, 26 Feb 2015 20:24:09 -0500 Received: from mail.kernel.org ([198.145.29.136]:42514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752652AbbB0BYJ (ORCPT ); Thu, 26 Feb 2015 20:24:09 -0500 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A76932021F; Fri, 27 Feb 2015 01:24:07 +0000 (UTC) Received: from localhost (unknown [166.170.41.179]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ADB102021A; Fri, 27 Feb 2015 01:24:06 +0000 (UTC) From: Jaegeuk Kim To: Dave Chinner Cc: fstests@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Jaegeuk Kim , Filipe Manana , Eric Sandeen Subject: [PATCH 2/2] generic/066: add _require_metadata_replay Date: Thu, 26 Feb 2015 17:23:47 -0800 Message-Id: <1425000227-69601-2-git-send-email-jaegeuk@kernel.org> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1425000227-69601-1-git-send-email-jaegeuk@kernel.org> References: <1425000227-69601-1-git-send-email-jaegeuk@kernel.org> X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds _require_metadata_replay to detect whether or not filesystem supports metadata replay. This should be used when: 1. create file A 2. write file A 3. fsync file A 4. write file A 5. create file B 6. fsync file B 7. crash! In this case, if filesystem supports metadata_replay, file A's data written by #4 should be recovered. Otherwise, file A is recovered to #3. Cc: Filipe Manana Cc: Eric Sandeen Signed-off-by: Jaegeuk Kim --- common/rc | 18 ++++++++++++++++++ tests/generic/066 | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/common/rc b/common/rc index 1ed9df5..e6e8d1f 100644 --- a/common/rc +++ b/common/rc @@ -2372,6 +2372,24 @@ _require_metadata_journaling() esac } +# Does this filesystem support metadata replay? +# Filesystem is able to recover metadata which were not written by fsync +# exlicitly. But another fsync'ed metadata should be followed by them. +_require_metadata_replay() +{ + _require_metadata_journaling $1 + + case "$FSTYP" in + f2fs) + # f2fs supports metadata_journaling, but does not recover any + # intermediate metadata which was not fsync'ed explicitly. + _notrun "$FSTYP does not support metadata replay" + ;; + *) + ;; + esac +} + # Does fiemap support? _require_fiemap() { diff --git a/tests/generic/066 b/tests/generic/066 index cb36506..3fefda4 100755 --- a/tests/generic/066 +++ b/tests/generic/066 @@ -61,7 +61,7 @@ _need_to_be_root _require_scratch _require_dm_flakey _require_attrs -_require_metadata_journaling $SCRATCH_DEV +_require_metadata_replay $SCRATCH_DEV _crash_and_mount() {