public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Murphy Zhou <xzhou@redhat.com>
Cc: fstests@vger.kernel.org, ddouwsma@redhat.com
Subject: Re: [PATCH v2] tests/xfs: check available blocks after log recovery on ro mount
Date: Mon, 23 Aug 2021 10:43:16 -0700	[thread overview]
Message-ID: <20210823174316.GE12612@magnolia> (raw)
In-Reply-To: <20210823070541.mn2y4pn4256dwnhm@xzhoux.usersys.redhat.com>

On Mon, Aug 23, 2021 at 03:05:41PM +0800, Murphy Zhou wrote:
> And followed by a rw mount.
> 
> Suggested-by:  Donald Douwsma <ddouwsma@redhat.com>
> Signed-off-by: Murphy Zhou <xzhou@redhat.com>
> ---
> v2:
>    Add explaination of the issue
>    add xfs_force_bdev data $SCRATCH_MNT
>    use DF_PROG
>    Re numbered this test
> 
>  tests/xfs/999     | 61 +++++++++++++++++++++++++++++++++++++++++++++++
>  tests/xfs/999.out |  2 ++
>  2 files changed, 63 insertions(+)
>  create mode 100755 tests/xfs/999
>  create mode 100644 tests/xfs/999.out
> 
> diff --git a/tests/xfs/999 b/tests/xfs/999
> new file mode 100755
> index 00000000..c93ed770
> --- /dev/null
> +++ b/tests/xfs/999
> @@ -0,0 +1,61 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2021 RedHat All Rights Reserved.
> +#
> +# FS QA Test 999
> +#
> +# Testcase for kernel commit:
> +#   50d25484bebe xfs: sync lazy sb accounting on quiesce of read-only mounts
> +#
> +# After shutdown and readonly mount, a following read-write mount would
> +# get wrong number of available blocks. This is caused by unmounting the log
> +# on a readonly filesystem doesn't log the sb counters.
> +#
> +. ./common/preamble
> +_begin_fstest shutdown auto quick
> +
> +# real QA test starts here
> +
> +_supported_fs xfs
> +_require_scratch

Also needs
_require_scratch_shutdown

> +
> +_scratch_mkfs > $seqres.full 2>&1
> +mount $SCRATCH_DEV $SCRATCH_MNT

_scratch_mount?

> +_xfs_force_bdev data $SCRATCH_MNT
> +
> +# Write test file
> +ls > $SCRATCH_MNT/testfile
> +$DF_PROG $SCRATCH_MNT >> $seqres.full 2>&1
> +
> +# Shutdown
> +$XFS_IO_PROG -x -c "shutdown -f" $SCRATCH_MNT
> +
> +# Mount ReadOnly
> +_scratch_unmount
> +_scratch_mount -oro
> +$DF_PROG $SCRATCH_MNT >> $seqres.full 2>&1
> +# Umount and mount rw
> +_scratch_unmount
> +_scratch_mount
> +
> +# Get fdblocks before repair
> +fdb1=$($DF_PROG $SCRATCH_MNT | tail -1 | $AWK_PROG '{print $4}')

fdb1=$(_get_available_space $SCRATCH_MNT) ?

> +_scratch_unmount
> +
> +# Repair
> +_repair_scratch_fs >> $seqres.full 2>&1
> +
> +# Re-mount
> +_scratch_mount
> +
> +# Get fdblocks after repair
> +fdb2=$($DF_PROG $SCRATCH_MNT | tail -1 | $AWK_PROG '{print $4}')

Here too.

With those bits fixed, I think this is in good shape for:
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> +
> +echo fdb1 $fdb1 fdb2 $fdb2 >> $seqres.full 2>&1
> +
> +[ $fdb1 -ne $fdb2 ] && echo Wrong fdblocks: $fdb1 and $fdb2
> +
> +# success, all done
> +echo "Silence is golden"
> +status=0
> +exit
> diff --git a/tests/xfs/999.out b/tests/xfs/999.out
> new file mode 100644
> index 00000000..3b276ca8
> --- /dev/null
> +++ b/tests/xfs/999.out
> @@ -0,0 +1,2 @@
> +QA output created by 999
> +Silence is golden
> -- 
> 2.20.1
> 

  reply	other threads:[~2021-08-23 17:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06  1:49 [PATCH] tests/xfs: check avail blocks after log recovery on ro mount Murphy Zhou
2021-08-06 18:55 ` Darrick J. Wong
2021-08-23  7:05   ` [PATCH v2] tests/xfs: check available " Murphy Zhou
2021-08-23 17:43     ` Darrick J. Wong [this message]
2021-08-24  5:04       ` [PATCH v3] " Murphy Zhou
2021-08-24  5:42         ` Eryu Guan
2021-08-24  6:23         ` Zorro Lang
2021-08-24  9:06           ` [PATCH v4] tests/generic: check log recovery with readonly mount Murphy Zhou
2021-08-24 12:57             ` Zorro Lang
2021-08-24 23:22           ` [PATCH v3] tests/xfs: check available blocks after log recovery on ro mount Donald Douwsma
2021-08-25  1:06             ` Donald Douwsma
2021-08-25  3:26               ` [PATCH v5] tests/generic: check log recovery with readonly mount Murphy Zhou
2021-08-26  0:17                 ` Darrick J. Wong
2021-08-26  7:01                 ` Zorro Lang
2021-08-24 15:14         ` [PATCH v3] tests/xfs: check available blocks after log recovery on ro mount Darrick J. Wong
2021-08-24 16:53           ` Zorro Lang
2021-08-25 23:43             ` Darrick J. Wong
2021-08-26  0:00               ` Murphy Zhou
2021-08-26  0:15                 ` Darrick J. Wong
2021-08-26  6:59               ` Zorro Lang

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=20210823174316.GE12612@magnolia \
    --to=djwong@kernel.org \
    --cc=ddouwsma@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=xzhou@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox