diff options
Diffstat (limited to 'libglusterfs')
-rw-r--r-- | libglusterfs/src/syncop.c | 11 | ||||
-rw-r--r-- | libglusterfs/src/syncop.h | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index cbd202515..2f80f5d80 100644 --- a/libglusterfs/src/syncop.c +++ b/libglusterfs/src/syncop.c @@ -989,9 +989,13 @@ syncop_readv (xlator_t *subvol, fd_t *fd, size_t size, off_t off, SYNCOP (subvol, (&args), syncop_readv_cbk, subvol->fops->readv, fd, size, off, flags, NULL); + if (args.op_ret < 0) + goto out; + if (vector) *vector = args.vector; - else GF_FREE (args.vector); + else + GF_FREE (args.vector); if (count) *count = args.count; @@ -1002,6 +1006,7 @@ syncop_readv (xlator_t *subvol, fd_t *fd, size_t size, off_t off, else if (args.iobref) iobref_unref (args.iobref); +out: errno = args.op_errno; return args.op_ret; @@ -1220,12 +1225,12 @@ syncop_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } int -syncop_fsync (xlator_t *subvol, fd_t *fd) +syncop_fsync (xlator_t *subvol, fd_t *fd, int dataonly) { struct syncargs args = {0, }; SYNCOP (subvol, (&args), syncop_fsync_cbk, subvol->fops->fsync, - fd, 0, NULL); + fd, dataonly, NULL); errno = args.op_errno; return args.op_ret; diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h index 9f87673d4..619fe7119 100644 --- a/libglusterfs/src/syncop.h +++ b/libglusterfs/src/syncop.h @@ -246,7 +246,7 @@ int syncop_truncate (xlator_t *subvol, loc_t *loc, off_t offset); int syncop_unlink (xlator_t *subvol, loc_t *loc); -int syncop_fsync (xlator_t *subvol, fd_t *fd); +int syncop_fsync (xlator_t *subvol, fd_t *fd, int dataonly); int syncop_flush (xlator_t *subvol, fd_t *fd); int syncop_fstat (xlator_t *subvol, fd_t *fd, struct iatt *stbuf); int syncop_stat (xlator_t *subvol, loc_t *loc, struct iatt *stbuf); |