History

gfs2: Add trusted xattr support

Add support for an additional filesystem version (sb_fs_format = 1802). When a filesystem with the new version is mounted, the filesystem supports "trusted.*" xattrs. In addition, version 1802 filesystems implement a form of forward compatibility for xattrs: when xattrs with an unknown prefix (ea_type) are found on a version 1802 filesystem, those attributes are not shown by listxattr, and they are not accessible by getxattr, setxattr, or removexattr. This mechanism might turn out to be what we need in the future, but if not, we can always bump the filesystem version and break compatibility instead.

Andreas Gruenbacher committed 5 years ago

Commit 866eef41 parent 47b7ec14 files · +63 −8Browse files

Showing the changes to include/uapi (1 of 4 files). Show all

Unified · Split

include/uapi/linux/gfs2_ondisk.h+3−2
@@ -47,7 +47,7 @@ · 46 unmodified lines
4747 #define GFS2_FORMAT_DE 1200
4848 #define GFS2_FORMAT_QU 1500
4949 /* These are part of the superblock */
50−#define GFS2_FORMAT_FS 1801
50+#define GFS2_FORMAT_FS 1802
5151 #define GFS2_FORMAT_MULTI 1900
5252
5353 /*
@@ -389,8 +389,9 @@ struct gfs2_leaf { · 335 unmodified lines
389389 #define GFS2_EATYPE_USR 1
390390 #define GFS2_EATYPE_SYS 2
391391 #define GFS2_EATYPE_SECURITY 3
392+#define GFS2_EATYPE_TRUSTED 4
392393
393−#define GFS2_EATYPE_LAST 3
394+#define GFS2_EATYPE_LAST 4
394395 #define GFS2_EATYPE_VALID(x) ((x) <= GFS2_EATYPE_LAST)
395396
396397 #define GFS2_EAFLAG_LAST 0x01 /* last ea in block */