From 83c650fe5b11a177b56274483aeecd3127520831 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Thu, 25 Feb 2010 15:38:04 +0000 Subject: distribute: Restore inode from saved ino on readv Signed-off-by: Shehjar Tikoo Signed-off-by: Anand V. Avati BUG: 597 (miscellaneous fixes for xlators to work well with NFS xlator) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=597 --- xlators/cluster/dht/src/dht-common.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'xlators') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 7dcc7205a..fe97b7285 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -1716,6 +1716,15 @@ dht_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this, struct iovec *vector, int count, struct stat *stbuf, struct iobref *iobref) { + dht_local_t *local = frame->local; + + if (!local) { + op_ret = -1; + op_errno = EINVAL; + goto out; + } + stbuf->st_ino = local->st_ino; +out: DHT_STACK_UNWIND (readv, frame, op_ret, op_errno, vector, count, stbuf, iobref); @@ -1729,7 +1738,7 @@ dht_readv (call_frame_t *frame, xlator_t *this, { xlator_t *subvol = NULL; int op_errno = -1; - + dht_local_t *local = NULL; VALIDATE_OR_GOTO (frame, err); VALIDATE_OR_GOTO (this, err); @@ -1743,6 +1752,14 @@ dht_readv (call_frame_t *frame, xlator_t *this, goto err; } + local = dht_local_init (frame); + if (!local) { + gf_log (this->name, GF_LOG_ERROR, "Out of memory"); + op_errno = ENOMEM; + goto err; + } + + local->st_ino = fd->inode->ino; STACK_WIND (frame, dht_readv_cbk, subvol, subvol->fops->readv, fd, size, off); -- cgit