On 10/31/17, 9:48 AM, "David Sterba" <dste...@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?

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.

Tested-by: Nick Terrell <terre...@fb.com>

> The incompat bit for zstd is not set, so this could lead to a filesystem
> with a zstd compression in the extents but no flag for the filesystem.
>
> Fixes: 5c1aab1dd5445ed8bd ("btrfs: Add zstd support")
> CC: Nick Terrell <terre...@fb.com>
> Signed-off-by: David Sterba <dste...@suse.com>


Reply via email to