Skip to content

Commit

Permalink
ovl: Add OVL_XATTR_TRUSTED/USER_PREFIX_LEN macros
Browse files Browse the repository at this point in the history
These match the ones for e.g. XATTR_TRUSTED_PREFIX_LEN.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
  • Loading branch information
Alexander Larsson authored and Amir Goldstein committed Oct 30, 2023
1 parent 420a62d commit d431e65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions fs/overlayfs/overlayfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ enum ovl_path_type {

#define OVL_XATTR_NAMESPACE "overlay."
#define OVL_XATTR_TRUSTED_PREFIX XATTR_TRUSTED_PREFIX OVL_XATTR_NAMESPACE
#define OVL_XATTR_TRUSTED_PREFIX_LEN (sizeof(OVL_XATTR_TRUSTED_PREFIX) - 1)
#define OVL_XATTR_USER_PREFIX XATTR_USER_PREFIX OVL_XATTR_NAMESPACE
#define OVL_XATTR_USER_PREFIX_LEN (sizeof(OVL_XATTR_USER_PREFIX) - 1)

enum ovl_xattr {
OVL_XATTR_OPAQUE,
Expand Down
4 changes: 2 additions & 2 deletions fs/overlayfs/xattrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ bool ovl_is_private_xattr(struct super_block *sb, const char *name)

if (ofs->config.userxattr)
return strncmp(name, OVL_XATTR_USER_PREFIX,
sizeof(OVL_XATTR_USER_PREFIX) - 1) == 0;
OVL_XATTR_USER_PREFIX_LEN) == 0;
else
return strncmp(name, OVL_XATTR_TRUSTED_PREFIX,
sizeof(OVL_XATTR_TRUSTED_PREFIX) - 1) == 0;
OVL_XATTR_TRUSTED_PREFIX_LEN) == 0;
}

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

0 comments on commit d431e65

Please sign in to comment.