Linux-BTRFS Archive on lore.kernel.org
 help / color / Atom feed
From: Kusanagi Kouichi <slash@ac.auone-net.jp>
To: dsterba@suse.cz
Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] btrfs: Implement lazytime
Date: Fri, 17 Jan 2020 03:01:07 +0900
Message-ID: <20200116180107663.NIUO.69338.ppp.dion.ne.jp@dmta0002.auone-net.jp> (raw)
In-Reply-To: <20200115163128.GT3929@twin.jikos.cz>

[-- Attachment #1: Type: text/plain, Size: 868 bytes --]

On 2020-01-15 17:31:28 +0100, David Sterba wrote:
> On Wed, Jan 15, 2020 at 10:45:36PM +0900, Kusanagi Kouichi wrote:
> > On 2020-01-14 22:21:07 +0100, David Sterba wrote:
> > > On Tue, Jan 14, 2020 at 05:53:24PM +0900, Kusanagi Kouichi wrote:
> > > > I tested with xfstests and lazytime didn't cause any new failures.
> > > 
> > > The changelog should describe what the patch does (the 'why' part too,
> > > but this is obvious from the subject in this case). That fstests pass
> > > without new failures is nice but there should be a specific test for
> > > that or instructions in the changelog how to test.
> > 
> > To test lazytime, I set the following variables:
> > TEST_FS_MOUNT_OPTS="-o lazytime,space_cache=v2"
> > MOUNT_OPTIONS="-o lazytime,space_cache=v2"
> 
> How did you verify that the lazy time updates were applied properly?

I ran the attached test.

[-- Attachment #2: lazytime-test.diff --]
[-- Type: text/plain, Size: 2310 bytes --]

diff --git a/tests/generic/999 b/tests/generic/999
new file mode 100755
index 00000000..781b37c5
--- /dev/null
+++ b/tests/generic/999
@@ -0,0 +1,76 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2019 Kusanagi Kouichi.  All Rights Reserved.
+#
+# FS QA Test 999
+#
+# Test timestamp is persistent across umount.
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+
+_scratch_mkfs > /dev/null 2>&1
+_scratch_mount
+
+check_persist()
+{
+    ls "$SCRATCH_MNT" > /dev/null
+    before="$(stat -c '%x %y %z' "$SCRATCH_MNT")"
+    $XFS_IO_PROG -c "$1" "$SCRATCH_MNT"
+    _scratch_cycle_mount strictatime
+    after="$(stat -c '%x %y %z' "$SCRATCH_MNT")"
+    if test "$before" != "$after"
+    then
+	echo "timestamp didn't persist across umount."
+	echo "ls $1"
+	echo "before $before"
+	echo "after  $after"
+	exit
+    fi
+}
+
+check_persist ''
+check_persist fsync
+check_persist syncfs
+check_persist sync
+
+"$FSSTRESS_PROG" -d "$SCRATCH_MNT" -v $(_scale_fsstress_args -n 1000 -p 2) > "$tmp".fsstress
+find "$SCRATCH_MNT" ! -type d -exec stat -c '%x %y %z %i %F %n' '{}' + > "$tmp".before
+_scratch_cycle_mount
+find "$SCRATCH_MNT" ! -type d -exec stat -c '%x %y %z %i %F %n' '{}' + > "$tmp".after
+if ! diff -u "$tmp".before "$tmp".after
+then
+    echo "timestamp didn't persist across umount after fsstress."
+    cat "$tmp".fsstress
+    exit
+fi
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/999.out b/tests/generic/999.out
new file mode 100644
index 00000000..7fbc6768
--- /dev/null
+++ b/tests/generic/999.out
@@ -0,0 +1 @@
+QA output created by 999
diff --git a/tests/generic/group b/tests/generic/group
index 6fe62505..7879eb70 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -595,3 +595,4 @@
 590 auto prealloc preallocrw
 591 auto quick rw pipe splice
 592 auto quick encrypt
+999 auto quick

      reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14  8:53 Kusanagi Kouichi
2020-01-14 13:44 ` Josef Bacik
2020-01-15 13:41   ` Kusanagi Kouichi
2020-01-14 21:21 ` David Sterba
2020-01-15 13:45   ` Kusanagi Kouichi
2020-01-15 16:31     ` David Sterba
2020-01-16 18:01       ` Kusanagi Kouichi [this message]

Reply instructions:

You may reply publically 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=20200116180107663.NIUO.69338.ppp.dion.ne.jp@dmta0002.auone-net.jp \
    --to=slash@ac.auone-net.jp \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

Linux-BTRFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-btrfs/0 linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ https://lore.kernel.org/linux-btrfs \
		linux-btrfs@vger.kernel.org
	public-inbox-index linux-btrfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-btrfs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git