From: Florian Weimer <fweimer@redhat.com>
To: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk
Subject: [PATCH 1/3] vfs: Introduce XATTR_SET_MASK
Date: Mon, 20 Jan 2014 15:15:10 +0100 [thread overview]
Message-ID: <20140121135811.1754B401159C7@oldenburg.str.redhat.com> (raw)
This will be used to separate the xattr operations from the AT_* flags.
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Florian Weimer <fweimer@redhat.com>
---
fs/xattr.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/xattr.c b/fs/xattr.c
index 3377dff..9e44641 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -24,6 +24,8 @@
#include <asm/uaccess.h>
+#define XATTR_SET_MASK (XATTR_CREATE | XATTR_REPLACE)
+
/*
* Check permissions for extended attribute access. This is a bit complicated
* because different namespaces have very different rules.
@@ -327,7 +329,7 @@ setxattr(struct dentry *d, const char __user *name, const void __user *value,
void *vvalue = NULL; /* If non-NULL, we used vmalloc() */
char kname[XATTR_NAME_MAX + 1];
- if (flags & ~(XATTR_CREATE|XATTR_REPLACE))
+ if (flags & ~XATTR_SET_MASK)
return -EINVAL;
error = strncpy_from_user(kname, name, sizeof(kname));
--
1.8.3.1
reply other threads:[~2014-01-21 13:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20140121135811.1754B401159C7@oldenburg.str.redhat.com \
--to=fweimer@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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 NNTP newsgroup(s).