diff options
| author | Shehjar Tikoo <shehjart@gluster.com> | 2010-02-25 15:38:04 +0000 | 
|---|---|---|
| committer | Anand V. Avati <avati@dev.gluster.com> | 2010-03-04 03:13:17 -0800 | 
| commit | 83c650fe5b11a177b56274483aeecd3127520831 (patch) | |
| tree | c8d9a40b138ba37fdfb65e3579a33b9d42a5d0d5 | |
| parent | 0a86bd1aa3004a9f27e59eb08f8facf312234737 (diff) | |
distribute: Restore inode from saved ino on readv
Signed-off-by: Shehjar Tikoo <shehjart@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
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
| -rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 19 | 
1 files changed, 18 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 7dcc7205ad0..fe97b728506 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);  | 
