diff options
author | Ravishankar N <ravishankar@redhat.com> | 2014-08-29 10:42:02 +0000 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-09-29 01:13:08 -0700 |
commit | 2a2f1130689d388f26b41f5df3e0bf572e0addb5 (patch) | |
tree | 7cef3f717baaea3969348d7c9668f6971416c503 /xlators/storage/posix/src/posix-helpers.c | |
parent | 7113d873af1f129effd8c6da21b49e797de8eab0 (diff) |
glusterfs: allow setxattr of keys with null values.
Disk based file systems allow to get/set extended attribute key-value pairs where
value can be null. Fuse/libgfapi clients must be able to do the same on a
gluster volume.
Change-Id: Ifc11134cc07f1a3ede43f9d027554dcd10b5c930
BUG: 1135514
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/8567
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix-helpers.c')
-rw-r--r-- | xlators/storage/posix/src/posix-helpers.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index 5f8984cc8a7..8584a68a0e8 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -130,7 +130,7 @@ _posix_xattr_get_set_from_backend (posix_xattr_filler_t *filler, char *key) xattr_size = sys_lgetxattr (filler->real_path, key, NULL, 0); - if (xattr_size > 0) { + if (xattr_size != -1) { value = GF_CALLOC (1, xattr_size + 1, gf_posix_mt_char); if (!value) @@ -138,7 +138,7 @@ _posix_xattr_get_set_from_backend (posix_xattr_filler_t *filler, char *key) xattr_size = sys_lgetxattr (filler->real_path, key, value, xattr_size); - if (xattr_size <= 0) { + if (xattr_size == -1) { gf_log (filler->this->name, GF_LOG_WARNING, "getxattr failed. path: %s, key: %s", filler->real_path, key); |