From 3093ff0b125c520fdac3db627af708f495c9a47e Mon Sep 17 00:00:00 2001 From: "Anand V. Avati" Date: Mon, 13 Apr 2009 15:41:01 +0530 Subject: client_readv_cbk - when op_ret is 0, iobuf comes NULL from transport, handles this case Signed-off-by: Anand V. Avati --- xlators/protocol/client/src/client-protocol.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'xlators') diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c index ce4fca95be1..f28466f83b3 100644 --- a/xlators/protocol/client/src/client-protocol.c +++ b/xlators/protocol/client/src/client-protocol.c @@ -4931,12 +4931,14 @@ client_readv_cbk (call_frame_t *frame, op_errno = gf_error_to_errno (ntoh32 (hdr->rsp.op_errno)); if (op_ret != -1) { + iobref = iobref_new (); gf_stat_to_stat (&rsp->stat, &stbuf); - vector.iov_base = iobuf->ptr; vector.iov_len = op_ret; - iobref = iobref_new (); - iobref_add (iobref, iobuf); + if (op_ret > 0) { + vector.iov_base = iobuf->ptr; + iobref_add (iobref, iobuf); + } } STACK_UNWIND (frame, op_ret, op_errno, &vector, 1, &stbuf, iobref); -- cgit