summaryrefslogtreecommitdiffstats
path: root/xlators/mount
diff options
context:
space:
mode:
authorRajesh Amaravathi <rajesh@gluster.com>2011-11-02 15:26:53 +0530
committerAnand Avati <avati@gluster.com>2011-11-11 02:09:48 -0800
commitbb67817cf582678685ce1207f2a1d41fb4c3649b (patch)
tree9322a30486704f90f7142194ec95be274871ba55 /xlators/mount
parentcb9ffbe767b8e5edb30bee95e33ebe9945101250 (diff)
debug/io-stats: prevent setfattr crash when no value given
Check for whether the dump file is given, and proceed on success. If dump file is not given, unwind with ENOENT. Change-Id: If524a2b20d643e0e75d81daebe59560a78000524 BUG: 3716 Reviewed-on: http://review.gluster.com/663 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'xlators/mount')
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 7e0022d3d58..54d09e6b260 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -2413,7 +2413,12 @@ fuse_setxattr (xlator_t *this, fuse_in_header_t *finh, void *msg)
return;
}
- dict_value = memdup (value, fsi->size);
+ 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->dict, newkey,
data_from_dynptr ((void *)dict_value, fsi->size));
dict_ref (state->dict);