From 3641846fa58210617c28f56b9713652f1a6dd798 Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Tue, 4 Aug 2009 04:40:04 +0000 Subject: cluster/afr: inode-read: Check stat buf for NULL before attempting to set inode number. Signed-off-by: Anand V. Avati BUG: 184 ([ glusterfs 2.0.6rc2 ] - Client Segfault while running fs-perf-test) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=184 --- xlators/cluster/afr/src/afr-inode-read.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'xlators') diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c index fa9a1e7fc..c26def93c 100644 --- a/xlators/cluster/afr/src/afr-inode-read.c +++ b/xlators/cluster/afr/src/afr-inode-read.c @@ -221,7 +221,7 @@ afr_stat_cbk (call_frame_t *frame, void *cookie, out: if (unwind) { - if (op_ret != -1) + if (buf) buf->st_ino = local->cont.stat.ino; AFR_STACK_UNWIND (frame, op_ret, op_errno, buf); @@ -345,7 +345,7 @@ afr_fstat_cbk (call_frame_t *frame, void *cookie, out: if (unwind) { - if (op_ret != -1) + if (buf) buf->st_ino = local->cont.fstat.ino; AFR_STACK_UNWIND (frame, op_ret, op_errno, buf); @@ -733,7 +733,8 @@ afr_readv_cbk (call_frame_t *frame, void *cookie, out: if (unwind) { - buf->st_ino = local->cont.readv.ino; + if (buf) + buf->st_ino = local->cont.readv.ino; AFR_STACK_UNWIND (frame, op_ret, op_errno, vector, count, buf, iobref); -- cgit