diff options
Diffstat (limited to 'xlators/features')
-rw-r--r-- | xlators/features/locks/src/posix.c | 3 | ||||
-rw-r--r-- | xlators/features/qemu-block/src/bdrv-xlator.c | 15 | ||||
-rw-r--r-- | xlators/features/qemu-block/src/qb-coroutines.c | 15 |
3 files changed, 16 insertions, 17 deletions
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index fce0d509f17..2db327687f3 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -552,7 +552,8 @@ fetch_pathinfo (xlator_t *this, inode_t *inode, int32_t *op_errno, ret = syncop_getxattr (FIRST_CHILD(this), &loc, &dict, GF_XATTR_PATHINFO_KEY); if (ret < 0) { - *op_errno = errno; + *op_errno = -ret; + ret = -1; goto out; } diff --git a/xlators/features/qemu-block/src/bdrv-xlator.c b/xlators/features/qemu-block/src/bdrv-xlator.c index 106c5977535..aaf028cfea5 100644 --- a/xlators/features/qemu-block/src/bdrv-xlator.c +++ b/xlators/features/qemu-block/src/bdrv-xlator.c @@ -109,7 +109,7 @@ qemu_gluster_open (BlockDriverState *bs, QDict *options, int bdrv_flags) NULL); if (ret) { loc_wipe(&loc); - return -errno; + return ret; } s->inode = inode_ref(loc.inode); @@ -153,7 +153,7 @@ qemu_gluster_create (const char *filename, QEMUOptionParameter *options) ret = syncop_fstat (FIRST_CHILD(THIS), fd, &stat); if (ret) { fd_unref (fd); - return -errno; + return ret; } if (stat.ia_size) { @@ -166,7 +166,7 @@ qemu_gluster_create (const char *filename, QEMUOptionParameter *options) ret = syncop_ftruncate (FIRST_CHILD(THIS), fd, total_size); if (ret) { fd_unref (fd); - return -errno; + return ret; } } @@ -196,10 +196,8 @@ qemu_gluster_co_readv (BlockDriverState *bs, int64_t sector_num, int nb_sectors, ret = syncop_readv (FIRST_CHILD(THIS), fd, size, offset, 0, &iov, &count, &iobref); - if (ret < 0) { - ret = -errno; + if (ret < 0) goto out; - } iov_copy (qiov->iov, qiov->niov, iov, count); /* *choke!* */ @@ -249,8 +247,6 @@ qemu_gluster_co_writev (BlockDriverState *bs, int64_t sector_num, int nb_sectors iov.iov_len = size; ret = syncop_writev (FIRST_CHILD(THIS), fd, &iov, 1, offset, iobref, 0); - if (ret < 0) - ret = -errno; out: if (iobuf) @@ -306,9 +302,6 @@ qemu_gluster_truncate (BlockDriverState *bs, int64_t offset) fd_unref (fd); - if (ret < 0) - return ret; - return ret; } diff --git a/xlators/features/qemu-block/src/qb-coroutines.c b/xlators/features/qemu-block/src/qb-coroutines.c index 7c52adb21ed..974312f1268 100644 --- a/xlators/features/qemu-block/src/qb-coroutines.c +++ b/xlators/features/qemu-block/src/qb-coroutines.c @@ -86,7 +86,7 @@ qb_format_and_resume (void *opaque) GF_FREE(qb_inode->backing_fname); if (ret) { loc_wipe(&loc); - ret = errno; + ret = -ret; goto err; } @@ -150,11 +150,10 @@ qb_format_and_resume (void *opaque) ret = syncop_fsetxattr (FIRST_CHILD(THIS), fd, xattr, 0); if (ret) { - ret = errno; gf_log (frame->this->name, GF_LOG_ERROR, "failed to setxattr for %s", uuid_utoa (inode->gfid)); - QB_STUB_UNWIND (stub, -1, ret); + QB_STUB_UNWIND (stub, -1, -ret); fd_unref (fd); dict_unref (xattr); return 0; @@ -476,7 +475,10 @@ qb_co_truncate (void *opaque) } } - syncop_fstat (FIRST_CHILD(this), local->fd, &stub->args_cbk.prestat); + ret = syncop_fstat (FIRST_CHILD(this), local->fd, + &stub->args_cbk.prestat); + if (ret < 0) + goto out; stub->args_cbk.prestat.ia_size = qb_inode->size; ret = bdrv_truncate (qb_inode->bs, stub->args.offset); @@ -487,7 +489,10 @@ qb_co_truncate (void *opaque) qb_inode->size = offset; - syncop_fstat (FIRST_CHILD(this), local->fd, &stub->args_cbk.poststat); + ret = syncop_fstat (FIRST_CHILD(this), local->fd, + &stub->args_cbk.poststat); + if (ret < 0) + goto out; stub->args_cbk.poststat.ia_size = qb_inode->size; qb_update_size_xattr (this, local->fd, qb_inode->fmt, qb_inode->size); |