From 432bcc798907c0e9870c1d600b14571d02fca3c2 Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Thu, 15 Jul 2010 03:21:54 +0000 Subject: Fix segmentation fault in client_mkdir committer: shishir gowda Signed-off-by: Anand V. Avati BUG: 975 (Crash in client_mkdir) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=975 --- xlators/protocol/client/src/client-protocol.c | 7 +++++++ 1 file changed, 7 insertions(+) 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); -- cgit