All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Disseldorp <ddiss@suse.de>
To: fdmanana@kernel.org
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org,
	Filipe Manana <fdmanana@suse.com>
Subject: Re: [PATCH 2/4] btrfs/173: make the test work when mounting with nodatacow
Date: Mon, 5 Feb 2024 23:26:00 +1100	[thread overview]
Message-ID: <20240205232600.15796771@echidna> (raw)
In-Reply-To: <0e243759cb9551eaac8b6f10f4dfbcbd5e880d56.1706810184.git.fdmanana@suse.com>

On Thu,  1 Feb 2024 18:03:48 +0000, fdmanana@kernel.org wrote:

> From: Filipe Manana <fdmanana@suse.com>
> 
> Currently btrfs/173 fails when passing "-o nodatacow" to MOUNT_OPTIONS
> because it assumes that when creating a file it does not have the
> nodatacow flag set, which is obviously not true if the fs is mounted with
> "-o nodatacow". To allow the test to run successfully with nodatacow,
> just make sure it clears the nodatacow flag from the file if the fs was
> mounted with "-o nodatacow".
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
> ---
>  tests/btrfs/173 | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/tests/btrfs/173 b/tests/btrfs/173
> index 6e78a826..42af2d26 100755
> --- a/tests/btrfs/173
> +++ b/tests/btrfs/173
> @@ -23,6 +23,11 @@ echo "COW file"
>  # unset it after the swap file has been created.
>  rm -f "$SCRATCH_MNT/swap"
>  touch "$SCRATCH_MNT/swap"
> +# Make sure we have a COW file if we were mounted with "-o nodatacow".
> +if _normalize_mount_options "$MOUNT_OPTIONS" | grep -q "nodatacow"; then
> +	_require_chattr C
> +	$CHATTR_PROG -C "$SCRATCH_MNT/swap"
> +fi

Nit: _format_swapfile already calls $CHATTR_PROG +C, so might as well
put the _require_chattr call alongside _require_scratch_swapfile

>  chmod 0600 "$SCRATCH_MNT/swap"
>  _pwrite_byte 0x61 0 $(($(_get_page_size) * 10)) "$SCRATCH_MNT/swap" >> $seqres.full
>  $MKSWAP_PROG "$SCRATCH_MNT/swap" >> $seqres.full


  reply	other threads:[~2024-02-05 12:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01 18:03 [PATCH 0/4] btrfs: make test pass or skip them when using nodatacow fdmanana
2024-02-01 18:03 ` [PATCH 1/4] btrfs: require no nodatacow for tests that exercise compression fdmanana
2024-02-01 18:03 ` [PATCH 2/4] btrfs/173: make the test work when mounting with nodatacow fdmanana
2024-02-05 12:26   ` David Disseldorp [this message]
2024-02-01 18:03 ` [PATCH 3/4] btrfs/299: skip test if we were mounted " fdmanana
2024-02-01 18:03 ` [PATCH 4/4] btrfs: require no nodatacow for tests that exercise read repair fdmanana
2024-02-05 12:29 ` [PATCH 0/4] btrfs: make test pass or skip them when using nodatacow David Disseldorp

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=20240205232600.15796771@echidna \
    --to=ddiss@suse.de \
    --cc=fdmanana@kernel.org \
    --cc=fdmanana@suse.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@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
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.