[PATCH 1/1] 9p: correctly check empty xattr key

From: Taesoo Kim
Date: Fri Mar 20 2015 - 00:02:11 EST


When xattr name (key) is empty (""), correctly return -EINVAL
error. Not sure how previous xattr_set_acl() performs with
any xattr key for get/set().

Signed-off-by: Taesoo Kim <tsgatesv@xxxxxxxxx>
---
fs/9p/acl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/9p/acl.c b/fs/9p/acl.c
index 8482f2d..295bf25 100644
--- a/fs/9p/acl.c
+++ b/fs/9p/acl.c
@@ -237,7 +237,7 @@ static int v9fs_xattr_get_acl(struct dentry *dentry, const char *name,
struct posix_acl *acl;
int error;

- if (strcmp(name, "") != 0)
+ if (strcmp(name, "") == 0)
return -EINVAL;

v9ses = v9fs_dentry2v9ses(dentry);
@@ -287,7 +287,7 @@ static int v9fs_xattr_set_acl(struct dentry *dentry, const char *name,
struct v9fs_session_info *v9ses;
struct inode *inode = dentry->d_inode;

- if (strcmp(name, "") != 0)
+ if (strcmp(name, "") == 0)
return -EINVAL;

v9ses = v9fs_dentry2v9ses(dentry);
--
2.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/