ext4: support STATX_ATTR_VERITY
authorEric Biggers <ebiggers@google.com>
Tue, 29 Oct 2019 20:41:39 +0000 (13:41 -0700)
committerEric Biggers <ebiggers@google.com>
Wed, 13 Nov 2019 20:15:34 +0000 (12:15 -0800)
Set the STATX_ATTR_VERITY bit when the statx() system call is used on a
verity file on ext4.

Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Eric Biggers <ebiggers@google.com>
fs/ext4/inode.c

index 516faa2..a7ca651 100644 (file)
@@ -5717,12 +5717,15 @@ int ext4_getattr(const struct path *path, struct kstat *stat,
                stat->attributes |= STATX_ATTR_IMMUTABLE;
        if (flags & EXT4_NODUMP_FL)
                stat->attributes |= STATX_ATTR_NODUMP;
+       if (flags & EXT4_VERITY_FL)
+               stat->attributes |= STATX_ATTR_VERITY;
 
        stat->attributes_mask |= (STATX_ATTR_APPEND |
                                  STATX_ATTR_COMPRESSED |
                                  STATX_ATTR_ENCRYPTED |
                                  STATX_ATTR_IMMUTABLE |
-                                 STATX_ATTR_NODUMP);
+                                 STATX_ATTR_NODUMP |
+                                 STATX_ATTR_VERITY);
 
        generic_fillattr(inode, stat);
        return 0;