From: David Sterba <dsterba@suse.cz>
To: Nick Terrell <terrelln@fb.com>
Cc: David Sterba <dsterba@suse.com>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: fix default compression value when set by SETFLAGS ioctl
Date: Wed, 1 Nov 2017 15:07:51 +0100 [thread overview]
Message-ID: <20171101140751.GE3521@twin.jikos.cz> (raw)
In-Reply-To: <6D6419B4-89D2-4581-8776-726007201343@fb.com>
On Tue, Oct 31, 2017 at 07:21:59PM +0000, Nick Terrell wrote:
> On 10/31/17, 9:48 AM, "David Sterba" <dsterba@suse.com> wrote:
> > The current default for the compression file flag is 'zlib', the zstd
> > patch silently changed that to zstd. Though the choice of zlib might not
> > be the best one, we should keep the backward compatibility.
>
> Sorry about that, I didn't intentionally change it. I checked over my patch,
> and the only other place where an "else" was changed is the other place in
> ioctl.c, which looks okay to me.
>
> I'm trying to expose the buggy case in 4.14-rc7. However, since
> fs_info->compress_type defaults to ZLIB when -compress is not passed, and
> when -compress=no is passed, fs_info->compress_type is not modified, I
> don't know how to get fs_info->compress_type to be BTRFS_COMPRESS_NONE.
> Is there a way that fs_info->compress_type can be BTRFS_COMPRESS_NONE?
And it turns out that this is not possible, fs_info::compress_type will
always be one of lzo/zlib/zstd. This is zlib by default, so any chattr +c
will set zlib. In order to set zstd by chattr, there would have to be at
least one mount with zstd or defrag -czstd. And this will set the
incompat bit.
> I modified -compress=no to set fs_info->compress_type=BTRFS_COMPRESS_NONE
> and the ioctl() call set the compression type to zstd before your patch,
> and zlib after, as expected.
I must have assumed that mounting with -o compress=no will reset the
compress_type. So unless I missed something else, the default will not
change and the feature flags match the actual filesystem state. False
alert, sorry. At least I don't have to send a late pull request.
prev parent reply other threads:[~2017-11-01 14:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-31 16:45 [PATCH] btrfs: fix default compression value when set by SETFLAGS ioctl David Sterba
2017-10-31 19:21 ` Nick Terrell
2017-11-01 14:07 ` David Sterba [this message]
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=20171101140751.GE3521@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=terrelln@fb.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