public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: Chung-Chiang Cheng <cccheng@synology.com>,
	fstests@vger.kernel.org, linux-btrfs@vger.kernel.org,
	fdmanana@kernel.org, dsterba@suse.com
Cc: shepjeng@gmail.com, kernel@cccheng.net
Subject: Re: [PATCH] fstests: btrfs: test setting compression via xattr on nodatacow files
Date: Tue, 19 Apr 2022 16:01:51 +0300	[thread overview]
Message-ID: <86175a32-eaff-b48b-9971-4bbd123127fc@suse.com> (raw)
In-Reply-To: <322a24a2-8ab3-63da-a284-e78663ddd0f8@suse.com>



On 19.04.22 г. 15:47 ч., Nikolay Borisov wrote:
> 
> 
> On 18.04.22 г. 10:54 ч., Chung-Chiang Cheng wrote:
>> Compression and nodatacow are mutually exclusive. Besides ioctl, there
>> is another way to setting compression via xattrs, and shouldn't produce
>> invalid combinations.
>>
>> Signed-off-by: Chung-Chiang Cheng <cccheng@synology.com>
>> ---
>>   tests/btrfs/264     | 76 +++++++++++++++++++++++++++++++++++++++++++++
>>   tests/btrfs/264.out | 15 +++++++++
>>   2 files changed, 91 insertions(+)
>>   create mode 100755 tests/btrfs/264
>>   create mode 100644 tests/btrfs/264.out
>>
>> diff --git a/tests/btrfs/264 b/tests/btrfs/264
>> new file mode 100755
>> index 000000000000..42bfcd4f93a0
>> --- /dev/null
>> +++ b/tests/btrfs/264
>> @@ -0,0 +1,76 @@
>> +#! /bin/bash
>> +# SPDX-License-Identifier: GPL-2.0
>> +# Copyright (C) 2022 Synology Inc. All Rights Reserved.
>> +#
>> +# FS QA Test No. 264
>> +#
>> +# Compression and nodatacow are mutually exclusive. Besides ioctl, there
>> +# is another way to setting compression via xattrs, and shouldn't 
>> produce
>> +# invalid combinations.
>> +#
>> +# To prevent mix any compression-related options with nodatacow, 
>> FS_NOCOMP_FL
>> +# is also rejected by ioctl as well as FS_COMPR_FL on nodatacow 
>> files. To
>> +# align with it, no and none are also unacceptable in this test.
>> +#
>> +# The regression is fixed by a patch with the following subject:
>> +#   btrfs: do not allow compression on nodatacow files
>> +#
>> +. ./common/preamble
>> +_begin_fstest auto quick compress attr
>> +
>> +# Import common functions.
>> +. ./common/filter
>> +. ./common/attr
>> +
>> +# real QA test starts here
>> +
>> +_supported_fs btrfs
>> +_require_scratch
>> +_require_chattr C
>> +_require_chattr c
>> +
>> +_scratch_mkfs >>$seqres.full 2>&1
>> +_scratch_mount
>> +
>> +#
>> +# DATACOW
>> +#
>> +test_file="$SCRATCH_MNT/foo"
>> +touch "$test_file"
>> +$CHATTR_PROG -C "$test_file"
>> +$LSATTR_PROG -l "$test_file" | _filter_scratch
>> +
>> +$SETFATTR_PROG -n "btrfs.compression" -v zlib "$test_file" |& 
>> _filter_scratch
> 
> In my testing setfattr doesn't produce any output, so why the 
> _filter_scratch ?

nit: Ah right, that applies to those setfattr calls that are expected to 
fail when doing the nodatacow ops. So perhaps you could only do |& on 
the setfattr calls which are expected to fail.

<snip>


SO the main thing which remains to fix is calling the _filter_spaces to 
ensure the test succeeds.

  reply	other threads:[~2022-04-19 13:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-18  7:54 [PATCH] fstests: btrfs: test setting compression via xattr on nodatacow files Chung-Chiang Cheng
2022-04-19 12:47 ` Nikolay Borisov
2022-04-19 13:01   ` Nikolay Borisov [this message]
2022-04-22 11:30   ` Chung-Chiang Cheng
2022-04-19 14:52 ` Filipe Manana
2022-04-22 11:11   ` Chung-Chiang Cheng
2022-04-22 14:31     ` Filipe Manana

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=86175a32-eaff-b48b-9971-4bbd123127fc@suse.com \
    --to=nborisov@suse.com \
    --cc=cccheng@synology.com \
    --cc=dsterba@suse.com \
    --cc=fdmanana@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=kernel@cccheng.net \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=shepjeng@gmail.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