summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c3
-rw-r--r--xlators/storage/posix/src/posix-helpers.c4
-rw-r--r--xlators/storage/posix/src/posix.c4
3 files changed, 4 insertions, 7 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 17335492465..380093a9a7a 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -3192,9 +3192,6 @@ fuse_setxattr (xlator_t *this, fuse_in_header_t *finh, void *msg)
if (fsi->size > 0) {
dict_value = memdup (value, fsi->size);
- } else {
- gf_log (THIS->name, GF_LOG_ERROR, "value size zero");
- dict_value = NULL;
}
dict_set (state->xattr, newkey,
data_from_dynptr ((void *)dict_value, fsi->size));
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);
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 090e53f0379..43bd3fc1cfd 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -3703,7 +3703,7 @@ posix_getxattr (call_frame_t *frame, xlator_t *this,
}
#endif
size = sys_lgetxattr (real_path, key, NULL, 0);
- if (size <= 0) {
+ if (size == -1) {
op_errno = errno;
if ((op_errno == ENOTSUP) || (op_errno == ENOSYS)) {
GF_LOG_OCCASIONALLY (gf_posix_xattr_enotsup_log,
@@ -3928,7 +3928,7 @@ posix_fgetxattr (call_frame_t *frame, xlator_t *this,
}
#endif
size = sys_fgetxattr (_fd, key, NULL, 0);
- if (size <= 0) {
+ if (size == -1) {
op_errno = errno;
gf_log (this->name,
((errno == ENODATA || errno == ENOATTR) ?