Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

f2fs: show compression in statx

fstest reports below message when compression is on:

generic/424 1s ... - output mismatch
--- tests/generic/424.out
+++ results/generic/424.out.bad
@@ -1,2 +1,26 @@
QA output created by 424
+[!] Attribute compressed should be set
+Failed
+stat_test failed
+[!] Attribute compressed should be set
+Failed
+stat_test failed

We missed to set STATX_ATTR_COMPRESSED on compressed inode in getattr(),
fix it.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

authored by

Chao Yu and committed by
Jaegeuk Kim
fd26725f 80d0d45a

+4 -1
+4 -1
fs/f2fs/file.c
··· 799 799 } 800 800 801 801 flags = fi->i_flags; 802 + if (flags & F2FS_COMPR_FL) 803 + stat->attributes |= STATX_ATTR_COMPRESSED; 802 804 if (flags & F2FS_APPEND_FL) 803 805 stat->attributes |= STATX_ATTR_APPEND; 804 806 if (IS_ENCRYPTED(inode)) ··· 812 810 if (IS_VERITY(inode)) 813 811 stat->attributes |= STATX_ATTR_VERITY; 814 812 815 - stat->attributes_mask |= (STATX_ATTR_APPEND | 813 + stat->attributes_mask |= (STATX_ATTR_COMPRESSED | 814 + STATX_ATTR_APPEND | 816 815 STATX_ATTR_ENCRYPTED | 817 816 STATX_ATTR_IMMUTABLE | 818 817 STATX_ATTR_NODUMP |