On Mon, May 14, 2018 at 11:46:09PM +0300, Timofey Titovets wrote:
> > > @@ -396,6 +396,14 @@ static inline int inode_need_compress(struct inode
> *inode, u64 start, u64 end)
> > > {
> > > struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
> > >
> > > + /*
> > > + * Btrfs doesn't support compression without csum or CoW.
> > > + * This should have the highest priority.
> > > + */
> > > + if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW ||
> > > + BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM)
> > > + return 0;
>
> > This is also the wrong place to fix that, NODATASUM or NODATACOW inode
> > should never make it to compress_file_range (that calls
> > inode_need_compress).
>
>
> David, i've talk about that some time ago:
> https://www.spinics.net/lists/linux-btrfs/msg73137.html
>
> NoCow files can be *easy* compressed.
I missed your previous mail, the issue with compression and nocow/nosum
is there. Seems like some of the combinations are not properly handled
when it's mount option vs defrag.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html