From bb67817cf582678685ce1207f2a1d41fb4c3649b Mon Sep 17 00:00:00 2001 From: Rajesh Amaravathi Date: Wed, 2 Nov 2011 15:26:53 +0530 Subject: 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 Reviewed-by: Amar Tumballi Reviewed-by: Anand Avati --- xlators/debug/io-stats/src/io-stats.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xlators/debug') diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c index 2e05be878..2786109b9 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) { -- cgit