diff options
author | Venky Shankar <vshankar@redhat.com> | 2015-03-15 03:43:49 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-03-24 06:34:33 -0700 |
commit | 3c474a042aed68659fe0cfdf32e01285bde9f689 (patch) | |
tree | 6229d9f3ba8de1946182ebf1b66803563cb21d71 /xlators/protocol/server | |
parent | 9f5addd987861d0a3a1144d576221a7f93af0970 (diff) |
core: Add inode context merge callback
Certain translators may require to update the inode context
of an already linked inode before unwinding the call to the
client. Normally, such a case in encountered during parallel
operations when a fresh inode is chosen at call (wind) time.
In the callback path, one of inodes is successfully linked
in the inode table, thereby the other inodes being thrown
away (and the inode pointers for these calls being pointed
to the linked inode).
Translators which may have strict dependency on the correct
value in the inode context would get stale values in inode
context. This patch introduces a new callback which provides
gives translators an opportunity to "patch" their respective
inode contexts. Note that, as of now, this callback is only
invoked during create()s unwind path. Although this might
needed to be done for all dentry fops and lookup, but let
that be done as an when required (bitrot stub requires
this *only* for create()).
Change-Id: I6cd91c2af473c44d1511208060d3978e580c67a6
BUG: 1170075
Original-Author: Raghavendra Bhat <rabhat@redhat.com>
Original-Author: Venky Shankar <vshankar@redhat.com>
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.org/9913
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/protocol/server')
-rw-r--r-- | xlators/protocol/server/src/server-rpc-fops.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/xlators/protocol/server/src/server-rpc-fops.c b/xlators/protocol/server/src/server-rpc-fops.c index 051b9771432..024cfc0b8d6 100644 --- a/xlators/protocol/server/src/server-rpc-fops.c +++ b/xlators/protocol/server/src/server-rpc-fops.c @@ -1580,6 +1580,7 @@ server_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, -- don't do this without understanding */ + inode_ctx_merge (fd, fd->inode, link_inode); inode_unref (fd->inode); fd->inode = inode_ref (link_inode); } |