Fix stat attributes_mask to return STATX_ATTR_ENCRYPTED whenever it is
possible. Also fix sanityn test_106c to expect at least the 0x30 flag
for attributes_mask.
Test-Parameters: trivial
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Icd16beff058c42d77e9b04ad1a287ec2ac04dfed
Reviewed-on: https://review.whamcloud.com/48208
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
}
stat->attributes_mask = STATX_ATTR_IMMUTABLE | STATX_ATTR_APPEND;
+#ifdef HAVE_LUSTRE_CRYPTO
+ stat->attributes_mask |= STATX_ATTR_ENCRYPTED;
+#endif
stat->attributes |= ll_inode_to_ext_flags(inode->i_flags);
stat->result_mask &= request_mask;
#endif
# Mask supported in stx_attributes by Lustre is
# STATX_ATTR_IMMUTABLE(0x10) | STATX_ATTR_APPEND(0x20) : (0x30).
mask=$($STATX -c %p $DIR/$tfile)
- [[ $mask == "30" ]] ||
- error "supported stx_attributes: got '$mask', expected '30'"
+ (( 0x$mask & 0x30 == 0x30 )) ||
+ error "supported stx_attributes: got '0x$mask', expected '0x30' at least"
chattr +i $DIR/$tfile || error "chattr +i $DIR/$tfile failed"
mask=$($STATX -c %r $DIR/$tfile)
[[ $mask == "10" ]] ||