From 2f2e3bfb5ef89b5ba266a3df7496f95b11fb93e1 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 17 Aug 2012 14:21:07 +0530 Subject: syncop: handle 'dataonly' flag in syncop_fsync() * and also in syncop_readv(), don't look at _cbk args if op_ret is < 0. Change-Id: I3ab2982bc6d186e75b6adb74c8981e4ff7058bbe Signed-off-by: Amar Tumballi BUG: 839950 Reviewed-on: http://review.gluster.org/3828 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- libglusterfs/src/syncop.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'libglusterfs/src/syncop.c') 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; -- cgit