linux-unionfs mirror
 help / color / mirror / Atom feed
From: Alexander Larsson <alexl@redhat.com>
To: miklos@szeredi.hu
Cc: linux-unionfs@vger.kernel.org, amir73il@gmail.com,
	Alexander Larsson <alexl@redhat.com>
Subject: [PATCH v4 2/5] ovl: Add OVL_XATTR_TRUSTED/USER_PREFIX_LEN macros
Date: Tue, 12 Sep 2023 11:55:56 +0200	[thread overview]
Message-ID: <27e6555e59d4b19e864725313b966d5ce5716e35.1694512044.git.alexl@redhat.com> (raw)
In-Reply-To: <cover.1694512044.git.alexl@redhat.com>

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>
---
 fs/overlayfs/overlayfs.h | 2 ++
 fs/overlayfs/xattrs.c    | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h
index 7b2a309bd746..dff7232b7bf5 100644
--- a/fs/overlayfs/overlayfs.h
+++ b/fs/overlayfs/overlayfs.h
@@ -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,
diff --git a/fs/overlayfs/xattrs.c b/fs/overlayfs/xattrs.c
index edc7cc49a7c4..b8ea96606ea8 100644
--- a/fs/overlayfs/xattrs.c
+++ b/fs/overlayfs/xattrs.c
@@ -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,
-- 
2.41.0


  parent reply	other threads:[~2023-09-12  9:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12  9:55 [PATCH v4 0/5] Support nested overlayfs mounts with xattrs and whiteous Alexander Larsson
2023-09-12  9:55 ` [PATCH v4 1/5] ovl: Move xattr support to new xattrs.c file Alexander Larsson
2023-09-12  9:55 ` Alexander Larsson [this message]
2023-09-12  9:55 ` [PATCH v4 3/5] ovl: Support escaped overlay.* xattrs Alexander Larsson
2023-09-12 12:05   ` Amir Goldstein
2023-09-12  9:55 ` [PATCH v4 4/5] ovl: Add an alternative type of whiteout Alexander Larsson
2023-09-12  9:55 ` [PATCH v4 5/5] ovl: Add documentation on nesting of overlayfs mounts Alexander Larsson
2023-09-12 12:08 ` [PATCH v4 0/5] Support nested overlayfs mounts with xattrs and whiteous Amir Goldstein
     [not found]   ` <CAL7ro1F9cuyXqQEgQHm1Fwo0vFJTUFVXuBXR-v9U1JUFpcW11Q@mail.gmail.com>
2023-09-12 16:20     ` Amir Goldstein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=27e6555e59d4b19e864725313b966d5ce5716e35.1694512044.git.alexl@redhat.com \
    --to=alexl@redhat.com \
    --cc=amir73il@gmail.com \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).