generic: Check the stx_attributes settable by chattr
authorDavid Howells <dhowells@redhat.com>
Mon, 10 Apr 2017 13:33:12 +0000 (14:33 +0100)
committerEryu Guan <eguan@redhat.com>
Tue, 11 Apr 2017 04:34:24 +0000 (12:34 +0800)
commitc3ff9ee3fe1b9e08da1a959c9de0e48e0449c2c9
tree91066174f97d3b4e6b1cb9791795221de1fb34cf
parentb22a8fe0c7af5cc008f0d7ea8c10fdbb24f277b3
generic: Check the stx_attributes settable by chattr

Check the stx_attributes that can be set by calling chattr.

The script probes the filesystem with chattr to find out which of
+a, +c, +d and +i are supported before testing combinations of
attrs.  Note that if a filesystem supports chattr with these, but
doesn't paste the flag values into stx_attributes, the test will
fail as there's no way to distinguish cleared from unset.

Certain chattr flags are reflected in specific stx_attributes flags:

chattr flag stx_attributes flag
+a STATX_ATTR_APPEND
+c STATX_ATTR_COMPRESSED
+d STATX_ATTR_NODUMP
+i STATX_ATTR_IMMUTABLE

Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
doc/requirement-checking.txt
src/stat_test.c
tests/generic/424 [new file with mode: 0755]
tests/generic/424.out [new file with mode: 0644]
tests/generic/group