From 347385beb519d75cd1457a36cf13a02fd2e60a92 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Wed, 14 Oct 2009 13:48:23 +0000 Subject: performance/write-behind:STACK_UNWIND happens only in failure path of wb_stat() Only in case of errors STACK_UNWIND happens in wb_stat(). Also, fixed an incorrect check which would fail all writes. Signed-off-by: Anand V. Avati BUG: 309 (In replicate set-up when exnihilate.sh is run , client crashes.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=309 --- xlators/performance/write-behind/src/write-behind.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xlators/performance/write-behind/src/write-behind.c') diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index 769fb507d99..0ea1ee328fa 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -643,6 +643,7 @@ wb_stat (call_frame_t *frame, xlator_t *this, loc_t *loc) FIRST_CHILD(this)->fops->stat, loc); } + return 0; unwind: STACK_UNWIND_STRICT (stat, frame, -1, op_errno, NULL); @@ -1828,7 +1829,7 @@ wb_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, } file = (wb_file_t *)(long)tmp_file; - if ((!S_ISDIR (fd->inode->st_mode)) && (file != NULL)) { + if ((!S_ISDIR (fd->inode->st_mode)) && (file == NULL)) { gf_log (this->name, GF_LOG_DEBUG, "wb_file not found for fd %p", fd); op_errno = EBADFD; -- cgit