Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: sys <system@lechevalier.se>
To: Hugo Mills <hugo@carfax.org.uk>, Josef Bacik <josef@toxicpanda.com>
Cc: Roman Mamedov <rm@romanrm.net>,
	linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH] btrfs: do not allow -o compress-force to override per-inode settings
Date: Mon, 30 Nov 2020 18:28:33 +0100 (GMT+01:00)	[thread overview]
Message-ID: <ca5d9e2.92cebc91.1761a32ec87@lechevalier.se> (raw)
In-Reply-To: <20201130150409.GH1908@savella.carfax.org.uk>



---- From: Hugo Mills <hugo@carfax.org.uk> -- Sent: 2020-11-30 - 16:04 ----

> On Mon, Nov 30, 2020 at 09:50:13AM -0500, Josef Bacik wrote:
>> On 11/30/20 9:08 AM, Roman Mamedov wrote:
>> > On Mon, 30 Nov 2020 08:46:21 -0500
>> > Josef Bacik <josef@toxicpanda.com> wrote:
>> > 
>> > > However some time later we got chattr -c, which is a user way of
>> > > indicating that the file shouldn't be compressed.  This is at odds with
>> > > -o compress-force.  We should be honoring what the user wants, which is
>> > > to disable compression.
>> > 
>> > But chattr -c only removes the previously set chattr +c. There's no
>> > "negative-c" to be forced by user in attributes. And +c is already unset on all
>> > files by default. Unless I'm missing something? Thanks
>> > 
>> 
>> The thing you're missing is that when we do chattr -c we're setting
>> NOCOMPRESS on the file.  The thing that I'm missing is what exactly we're
>> trying to allow.  If chattr -c is supposed to just be the removal of +c,
>> then btrfs is doing the wrong thing by setting NOCOMPRESS.  We also do the
>> same thing when we clear a btrfs.compression property.
> 
>    If I'm understanding this right, there's more than two states
> here. There's a "default", and there's two "force" options -- forcing
> nocompress, and forcing/allowing compression. If there's no c flag
> set, the file could be in one of two states: default behaviour
> (presumably defined by the value of the mount options), and
> NOCOMPRESS. How do I tell which it is?

 Fsattr (chattr/lsattr) seem to have been a simplified way of exposing the compression xattr to users, wasn't it? Could it not be better to promote the use of btrfs.compression xattrs instead? 

> 
>> I guess the question is what do we want?  Do we want to only allow the user
>> to indicate we want compression, or do we want to allow them to also
>> indicate that they don't want compression? 

I think it is a good thing to have the three options, but we may need to drop the use of chattr/lsattr and go with only xattrs. 

Thanks, 
Forza 

 If we don't want to enable them
>> to disable compression for a file, then this patch needs to be thrown away,
>> but then we also need to fix up all the places we set NOCOMPRESS when we
>> clear these flags.  Thanks,
> 
>    Hugo.
> 
> -- 
> Hugo Mills             | The last man on Earth sat in a room. Suddenly, there
> hugo@... carfax.org.uk | was a knock at the door.
> http://carfax.org.uk/  |
> PGP: E2AB1DE4          |                                        Frederic Brown



      parent reply	other threads:[~2020-11-30 17:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-30 13:46 [PATCH] btrfs: do not allow -o compress-force to override per-inode settings Josef Bacik
2020-11-30 14:08 ` Roman Mamedov
2020-11-30 14:27   ` Amy Parker
2020-11-30 14:50   ` Josef Bacik
2020-11-30 15:01     ` Roman Mamedov
2020-11-30 15:10       ` Josef Bacik
2020-11-30 15:17         ` Roman Mamedov
2020-11-30 15:04     ` Hugo Mills
2020-11-30 15:12       ` Josef Bacik
2020-11-30 17:28       ` sys [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=ca5d9e2.92cebc91.1761a32ec87@lechevalier.se \
    --to=system@lechevalier.se \
    --cc=hugo@carfax.org.uk \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=rm@romanrm.net \
    /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