From: Ronnie Sahlberg Date: Sat, 25 Jun 2011 02:23:52 +0000 (+1000) Subject: redo the previous patch to instead initialize max_offset correctly before we invoke... X-Git-Tag: upstream/1.9.6^2~387 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=7ed9d87a5b7a5c05f3cb33274700b80016874a4a;p=deb_libnfs.git redo the previous patch to instead initialize max_offset correctly before we invoke the chunks. this is the correct way to fix this bug. --- diff --git a/lib/libnfs.c b/lib/libnfs.c index d1f4f0e..8d27a81 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -889,11 +889,8 @@ static void nfs_pread_mcb(struct rpc_context *rpc _U_, int status, void *command } data->nfsfh->offset = data->max_offset; - if (data->max_offset - data->start_offset >= 0) { - data->cb(data->max_offset - data->start_offset, nfs, data->buffer, data->private_data); - } else { - data->cb(0, nfs, data->buffer, data->private_data); - } + data->cb(data->max_offset - data->start_offset, nfs, data->buffer, data->private_data); + free_nfs_cb_data(data); free(mdata); } @@ -929,6 +926,7 @@ int nfs_pread_async(struct nfs_context *nfs, struct nfsfh *nfsfh, off_t offset, * reads and collect into a reassembly buffer. * we send all reads in parallell so that performance is still good. */ + data->max_offset = offset; data->start_offset = offset; data->buffer = malloc(count);