diff options
author | Rajesh Amaravathi <rajesh@gluster.com> | 2011-11-02 15:26:53 +0530 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-11-11 02:09:48 -0800 |
commit | bb67817cf582678685ce1207f2a1d41fb4c3649b (patch) | |
tree | 9322a30486704f90f7142194ec95be274871ba55 /xlators/debug/io-stats | |
parent | cb9ffbe767b8e5edb30bee95e33ebe9945101250 (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/debug/io-stats')
-rw-r--r-- | xlators/debug/io-stats/src/io-stats.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c index 2e05be878bc..2786109b969 100644 --- a/xlators/debug/io-stats/src/io-stats.c +++ b/xlators/debug/io-stats/src/io-stats.c @@ -2129,6 +2129,10 @@ conditional_dump (dict_t *dict, char *key, data_t *value, void *data) if (fnmatch ("*io*stat*dump", key, 0) == 0) { + if (!strncmp (filename, "", 1)) { + gf_log (this->name, GF_LOG_ERROR, "No filename given"); + return; + } logfp = fopen (filename, "w+"); GF_ASSERT (logfp); if (!logfp) { |