Searched hist:"4 b73c55fdebd8939f0f6000921075f7f6fa41397" (Results 1 – 3 of 3) sorted by relevance
/linux/fs/btrfs/ |
H A D | props.h | diff 4b73c55fdebd8939f0f6000921075f7f6fa41397 Thu Apr 21 12:01:22 CEST 2022 Filipe Manana <fdmanana@suse.com> btrfs: skip compression property for anything other than files and dirs
The compression property only has effect on regular files and directories (so that it's propagated to files and subdirectories created inside a directory). For any other inode type (symlink, fifo, device, socket), it's pointless to set the compression property because it does nothing and ends up unnecessarily wasting leaf space due to the pointless xattr (75 or 76 bytes, depending on the compression value). Symlinks in particular are very common (for example, I have almost 10k symlinks under /etc, /usr and /var alone) and therefore it's worth to avoid wasting leaf space with the compression xattr.
For example, the compression property can end up on a symlink or character device implicitly, through inheritance from a parent directory
$ mkdir /mnt/testdir $ btrfs property set /mnt/testdir compression lzo
$ ln -s yadayada /mnt/testdir/lnk $ mknod /mnt/testdir/dev c 0 0
Or explicitly like this:
$ ln -s yadayda /mnt/lnk $ setfattr -h -n btrfs.compression -v lzo /mnt/lnk
So skip the compression property on inodes that are neither a regular file nor a directory.
CC: stable@vger.kernel.org # 5.4+ Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
|
H A D | props.c | diff 4b73c55fdebd8939f0f6000921075f7f6fa41397 Thu Apr 21 12:01:22 CEST 2022 Filipe Manana <fdmanana@suse.com> btrfs: skip compression property for anything other than files and dirs
The compression property only has effect on regular files and directories (so that it's propagated to files and subdirectories created inside a directory). For any other inode type (symlink, fifo, device, socket), it's pointless to set the compression property because it does nothing and ends up unnecessarily wasting leaf space due to the pointless xattr (75 or 76 bytes, depending on the compression value). Symlinks in particular are very common (for example, I have almost 10k symlinks under /etc, /usr and /var alone) and therefore it's worth to avoid wasting leaf space with the compression xattr.
For example, the compression property can end up on a symlink or character device implicitly, through inheritance from a parent directory
$ mkdir /mnt/testdir $ btrfs property set /mnt/testdir compression lzo
$ ln -s yadayada /mnt/testdir/lnk $ mknod /mnt/testdir/dev c 0 0
Or explicitly like this:
$ ln -s yadayda /mnt/lnk $ setfattr -h -n btrfs.compression -v lzo /mnt/lnk
So skip the compression property on inodes that are neither a regular file nor a directory.
CC: stable@vger.kernel.org # 5.4+ Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
|
H A D | xattr.c | diff 4b73c55fdebd8939f0f6000921075f7f6fa41397 Thu Apr 21 12:01:22 CEST 2022 Filipe Manana <fdmanana@suse.com> btrfs: skip compression property for anything other than files and dirs
The compression property only has effect on regular files and directories (so that it's propagated to files and subdirectories created inside a directory). For any other inode type (symlink, fifo, device, socket), it's pointless to set the compression property because it does nothing and ends up unnecessarily wasting leaf space due to the pointless xattr (75 or 76 bytes, depending on the compression value). Symlinks in particular are very common (for example, I have almost 10k symlinks under /etc, /usr and /var alone) and therefore it's worth to avoid wasting leaf space with the compression xattr.
For example, the compression property can end up on a symlink or character device implicitly, through inheritance from a parent directory
$ mkdir /mnt/testdir $ btrfs property set /mnt/testdir compression lzo
$ ln -s yadayada /mnt/testdir/lnk $ mknod /mnt/testdir/dev c 0 0
Or explicitly like this:
$ ln -s yadayda /mnt/lnk $ setfattr -h -n btrfs.compression -v lzo /mnt/lnk
So skip the compression property on inodes that are neither a regular file nor a directory.
CC: stable@vger.kernel.org # 5.4+ Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
|