Skip to content

Commit fd26725

Browse files
chaseyuJaegeuk Kim
authored andcommitted
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 <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 80d0d45 commit fd26725

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/f2fs/file.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,8 @@ int f2fs_getattr(const struct path *path, struct kstat *stat,
799799
}
800800

801801
flags = fi->i_flags;
802+
if (flags & F2FS_COMPR_FL)
803+
stat->attributes |= STATX_ATTR_COMPRESSED;
802804
if (flags & F2FS_APPEND_FL)
803805
stat->attributes |= STATX_ATTR_APPEND;
804806
if (IS_ENCRYPTED(inode))
@@ -810,7 +812,8 @@ int f2fs_getattr(const struct path *path, struct kstat *stat,
810812
if (IS_VERITY(inode))
811813
stat->attributes |= STATX_ATTR_VERITY;
812814

813-
stat->attributes_mask |= (STATX_ATTR_APPEND |
815+
stat->attributes_mask |= (STATX_ATTR_COMPRESSED |
816+
STATX_ATTR_APPEND |
814817
STATX_ATTR_ENCRYPTED |
815818
STATX_ATTR_IMMUTABLE |
816819
STATX_ATTR_NODUMP |

0 commit comments

Comments
 (0)