Skip to content

Commit d431e65

Browse files
alexlarssonamir73il
authored andcommitted
ovl: Add OVL_XATTR_TRUSTED/USER_PREFIX_LEN macros
These match the ones for e.g. XATTR_TRUSTED_PREFIX_LEN. Signed-off-by: Alexander Larsson <[email protected]> Reviewed-by: Amir Goldstein <[email protected]> Signed-off-by: Amir Goldstein <[email protected]>
1 parent 420a62d commit d431e65

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

fs/overlayfs/overlayfs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ enum ovl_path_type {
2828

2929
#define OVL_XATTR_NAMESPACE "overlay."
3030
#define OVL_XATTR_TRUSTED_PREFIX XATTR_TRUSTED_PREFIX OVL_XATTR_NAMESPACE
31+
#define OVL_XATTR_TRUSTED_PREFIX_LEN (sizeof(OVL_XATTR_TRUSTED_PREFIX) - 1)
3132
#define OVL_XATTR_USER_PREFIX XATTR_USER_PREFIX OVL_XATTR_NAMESPACE
33+
#define OVL_XATTR_USER_PREFIX_LEN (sizeof(OVL_XATTR_USER_PREFIX) - 1)
3234

3335
enum ovl_xattr {
3436
OVL_XATTR_OPAQUE,

fs/overlayfs/xattrs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ bool ovl_is_private_xattr(struct super_block *sb, const char *name)
1010

1111
if (ofs->config.userxattr)
1212
return strncmp(name, OVL_XATTR_USER_PREFIX,
13-
sizeof(OVL_XATTR_USER_PREFIX) - 1) == 0;
13+
OVL_XATTR_USER_PREFIX_LEN) == 0;
1414
else
1515
return strncmp(name, OVL_XATTR_TRUSTED_PREFIX,
16-
sizeof(OVL_XATTR_TRUSTED_PREFIX) - 1) == 0;
16+
OVL_XATTR_TRUSTED_PREFIX_LEN) == 0;
1717
}
1818

1919
static int ovl_xattr_set(struct dentry *dentry, struct inode *inode, const char *name,

0 commit comments

Comments
 (0)