diff options
author | Raghavendra Bhat <raghavendra@redhat.com> | 2012-08-09 13:23:48 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2012-08-11 23:26:12 -0700 |
commit | eabf3911675562a920040d0fe1a783ece1beb341 (patch) | |
tree | 65ec43d8753b26db199474ad68073561e988f9ef /xlators | |
parent | e42faa7488b41513750ad37837ac52a68f639775 (diff) |
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 <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.com/3796
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/performance/write-behind/src/write-behind.c | 4 |
1 files changed, 3 insertions, 1 deletions
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, |