]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ovl: Add OVL_XATTR_TRUSTED/USER_PREFIX_LEN macros
authorAlexander Larsson <alexl@redhat.com>
Tue, 15 Aug 2023 07:33:44 +0000 (09:33 +0200)
committerAmir Goldstein <amir73il@gmail.com>
Mon, 30 Oct 2023 22:12:59 +0000 (00:12 +0200)
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>
fs/overlayfs/overlayfs.h
fs/overlayfs/xattrs.c

index 59ee6ba79ee88b728621c3753c2fc932a5377bae..1c0ad84646e86db2325b0a0cd97ef9d4786a5647 100644 (file)
@@ -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,
index 8e7e4ca62448b060413d2c5bce6ba12fdfc74f1c..d20032f8a53734b377ae982eff0ddf9177ff39ea 100644 (file)
@@ -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,