All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Dave Chinner <david@fromorbit.com>
Cc: fstests@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	Filipe Manana <fdmanana@suse.com>,
	Eric Sandeen <sandeen@redhat.com>
Subject: [PATCH 2/2] generic/066: add _require_metadata_replay
Date: Thu, 26 Feb 2015 17:23:47 -0800	[thread overview]
Message-ID: <1425000227-69601-2-git-send-email-jaegeuk@kernel.org> (raw)
In-Reply-To: <1425000227-69601-1-git-send-email-jaegeuk@kernel.org>

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 <fdmanana@suse.com>
Cc: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 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()
 {
-- 
2.1.1


  reply	other threads:[~2015-02-27  1:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27  1:23 [PATCH 1/2] generic/065: f2fs serves 64KB size with zero data Jaegeuk Kim
2015-02-27  1:23 ` Jaegeuk Kim [this message]
2015-02-27 11:34   ` [PATCH 2/2] generic/066: add _require_metadata_replay Lukáš Czerner
2015-02-27 11:43     ` [f2fs-dev] " Filipe David Manana
2015-02-27 13:10       ` Lukáš Czerner
2015-02-27 14:34         ` Filipe David Manana
2015-02-27 15:05           ` Lukáš Czerner
2015-02-27 15:09             ` Filipe David Manana
2015-03-18  3:33         ` Dave Chinner
2015-02-27 19:02     ` Jaegeuk Kim
2015-02-27  2:45 ` [PATCH 1/2] generic/065: f2fs serves 64KB size with zero data Eric Sandeen
2015-02-27  9:54   ` Lukáš Czerner
2015-02-27 10:31     ` [f2fs-dev] " Filipe David Manana
2015-02-27 11:03       ` Lukáš Czerner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425000227-69601-2-git-send-email-jaegeuk@kernel.org \
    --to=jaegeuk@kernel.org \
    --cc=david@fromorbit.com \
    --cc=fdmanana@suse.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=sandeen@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.