summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-inode-read.c
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2009-08-04 04:39:34 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-08-04 12:47:41 -0700
commite26e9b861d92edfb7c00aa1b7c8c3a4126a563fb (patch)
tree0e4b080ce7890ae710f0140365d7470d1ae61f69 /xlators/cluster/afr/src/afr-inode-read.c
parentacb06b282a64b2751d33424e4e833c0c7dcf87d7 (diff)
cluster/afr: inode-read: Check stat buf for NULL before attempting to set inode number.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> 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
Diffstat (limited to 'xlators/cluster/afr/src/afr-inode-read.c')
-rw-r--r--xlators/cluster/afr/src/afr-inode-read.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c
index 25fe69ca65c..2f9a6cda9fd 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);
@@ -796,7 +796,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);