summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2010-07-15 03:21:54 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-07-15 03:18:58 -0700
commit432bcc798907c0e9870c1d600b14571d02fca3c2 (patch)
tree33c81a3c93e0b4e33991169b32500ce783ac3858
parent3d6e03926c093433b27400f2b7682fc7ed9c5a7e (diff)
Fix segmentation fault in client_mkdir
committer: shishir gowda <shishirng@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 975 (Crash in client_mkdir) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=975
-rw-r--r--xlators/protocol/client/src/client-protocol.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c
index b00211507..d3ddc01f5 100644
--- a/xlators/protocol/client/src/client-protocol.c
+++ b/xlators/protocol/client/src/client-protocol.c
@@ -1020,6 +1020,13 @@ client_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode)
uint64_t gen = 0;
client_local_t *local = NULL;
+ if (loc->ino == 1) { /*Fail mkdir for root dir */
+ gf_log (this->name, GF_LOG_ERROR,
+ "MKDIR %"PRId64"/%s (%s): Failing mkdir call on "
+ "root", loc->ino, loc->name, loc->path);
+ goto unwind;
+ }
+
local = calloc (1, sizeof (*local));
GF_VALIDATE_OR_GOTO (this->name, local, unwind);