From: "koraynilay" <koray.fra@gmail.com>
To: "Qu Wenruo" <wqu@suse.com>, "koraynilay" <koray.fra@gmail.com>,
"Qu Wenruo" <quwenruo.btrfs@gmx.com>, <clm@fb.com>,
<dsterba@suse.com>
Cc: <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 0/4] btrfs: add per-inode compression levels in xattrs
Date: Sun, 09 Aug 2026 03:32:54 +0200 [thread overview]
Message-ID: <DKK0XWCI89MM.2G6KD41GSR46J@gmail.com> (raw)
In-Reply-To: <c5070299-46ba-460d-9ff7-0b2e4878079b@suse.com>
[-- Attachment #1: Type: text/plain, Size: 1737 bytes --]
> Mind to explain more about the "chattr +c" problem?
>
> IIRC "chattr +c" just set the btrfs.compression XATTR to the default
> zlib if no mount option is specified.
Hmm, I thought it as "I want to explicitely say to btrfs to compress
this file using whatever optins I set for the fs", e.g. in a situation
where a file was created without compress=, then compress= is used...but
that would be the exact same, as new data would be compressed all the
same because of compress=.
Another (very edge) use case I thought about was "file gets marked as
NOCOMPRESS, then gets truncated and compressible data gets written to it
so I want it to compress again" (since +c resets NOCOPRESS)...but I
hadn't tested it. Now that I did, I realized in that case it probably
wouldn't get past the compression heuristics so it wouldn't be marked as
NOCOMPRESS anyway.
> The only extra concern is, if we have a new level field in XATTR, can
> older kernels handle it?
>
> And thankfully the existing prop apply handler is checking only the
> first several bytes for different algos, thus the existing code should
> handle the extra appended ":<level>" correctly by just ignoring the level.
It should be fine, as the current code also accepts "zlibabcd",
"zlib:invalid" and so on; it gets applied successfully with btrfs prop
set and gets rightly compressed using "zlib" (well, using the level from
the mount point because of the "bug", but yeah).
> So either option 2 or 3 would be fine to me. Although I personally
> prefer option 3 a little more, just because it's much cleaner code wise.
I'll change it back to the simple assignment and send v2 of the patch
series then.
Thanks again.
Best,
koraynilay
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-08-09 1:33 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-08 2:34 [PATCH 0/4] btrfs: add per-inode compression levels in xattrs koraynilay
2026-08-08 2:34 ` [PATCH 1/4] btrfs: export btrfs_match_compress_type(), move it to compression.h koraynilay
2026-08-08 2:34 ` [PATCH 2/4] btrfs: also validate compression levels in btrfs_compress_is_valid_type() koraynilay
2026-08-08 2:34 ` [PATCH 3/4] btrfs: add per-inode compression levels in xattrs koraynilay
2026-08-08 2:34 ` [PATCH 4/4] btrfs: support inheritance for per-inode compression levels koraynilay
2026-08-09 0:17 ` [PATCH 0/4] btrfs: add per-inode compression levels in xattrs Qu Wenruo
2026-08-09 0:35 ` koraynilay
2026-08-09 1:00 ` Qu Wenruo
2026-08-09 1:32 ` koraynilay [this message]
2026-08-09 23:17 ` Zygo Blaxell
2026-08-09 23:20 ` Qu Wenruo
2026-08-10 0:28 ` Zygo Blaxell
2026-08-10 0:51 ` Qu Wenruo
2026-08-10 0:57 ` Zygo Blaxell
2026-08-10 1:05 ` koraynilay
2026-08-10 1:54 ` Qu Wenruo
2026-08-10 1:57 ` koraynilay
2026-08-10 1:57 ` Qu Wenruo
2026-08-10 2:06 ` Zygo Blaxell
2026-08-10 2:11 ` Qu Wenruo
2026-08-10 22:41 ` koraynilay
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=DKK0XWCI89MM.2G6KD41GSR46J@gmail.com \
--to=koray.fra@gmail.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo.btrfs@gmx.com \
--cc=wqu@suse.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 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.