From eabf3911675562a920040d0fe1a783ece1beb341 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Thu, 9 Aug 2012 13:23:48 +0530 Subject: performance/write-behind: store the wb_inode in local before winding * Store the write-behind's inode context in the local structure before winding the call so that in callback inode context is found. * Before returning EBADFD check if the inode context (wb_inode) is NULL, along with the inode type. Change-Id: If5a1c667efe6882a6efef1439cee3effc32ff9a7 BUG: 846536 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.com/3796 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/performance/write-behind/src/write-behind.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xlators/performance') diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index afbee6ce7b4..4082ffa9cc9 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -770,6 +770,7 @@ wb_sync (call_frame_t *frame, wb_inode_t *wb_inode, list_head_t *winds) frame->root->lk_owner = lk_owner; + local->wb_inode = wb_inode; sync_frame->local = local; local->fd = fd = fd_ref (request->stub->args.writev.fd); @@ -2802,7 +2803,7 @@ wb_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync, op_errno, EINVAL); wb_inode = wb_inode_ctx_get (this, fd->inode); - if ((!IA_ISDIR (fd->inode->ia_type))) { + if (wb_inode == NULL && (!IA_ISDIR (fd->inode->ia_type))) { gf_log (this->name, GF_LOG_WARNING, "write behind wb_inode pointer is" " not stored in context of inode(%p), " @@ -2818,6 +2819,7 @@ wb_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync, } frame->local = local; + local->wb_inode = wb_inode; if (wb_inode) { stub = fop_fsync_stub (frame, wb_fsync_helper, fd, datasync, -- cgit