diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2014-07-03 06:50:56 +0530 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2014-07-08 01:13:15 -0700 |
commit | 828fe8068de0f1357e5c26097e45d752b3f7f6c4 (patch) | |
tree | a6a4b77d81d9e9fffc2d963bf01b4e73000a5cb9 /xlators | |
parent | 98c1d1488cc5fe3b61c3118850d36195baa644a4 (diff) |
features/gfid-access: Fix entry operations
Backport of http://review.gluster.org/8204
Problem:
When more than one aux-mounts are performing rmdir .gfid/<pargfid>/dir
simultaneously, then sometimes a hang is observed. In gfid-access xlator When
virtual parent/inode are replaced with real parent/inode in loc, virtual
pargfid/gfid are not replaced with real pargfid/gfid respectively. Afr is using
parent_loc->gfids to order the entry locks. But parent_loc->gfid contains
random/virtual gfid generated by gfid-access xlator. Entrylk in client xlator
is using loc->inod->gfid for sending entrylk which has 'real' gfid. Because the
ordering is happening based on random gfids, One mount orders the locks as (L1,
L2) where as the other orders them as (L2, L1) leading to a dead-lock thus
a hang.
Fix:
Replace virtual pargfid/gfid with real pargfid/gfid when virtual-inodes are
replaced with real-inodes in loc.
BUG: 1114501
Change-Id: I13016de1da11762e0697792d76e6e946d991c0a4
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/8251
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/features/gfid-access/src/gfid-access.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/xlators/features/gfid-access/src/gfid-access.c b/xlators/features/gfid-access/src/gfid-access.c index 217864782b7..b16161b0ee9 100644 --- a/xlators/features/gfid-access/src/gfid-access.c +++ b/xlators/features/gfid-access/src/gfid-access.c @@ -30,6 +30,9 @@ ga_valid_inode_loc_copy (loc_t *dst, loc_t *src, xlator_t *this) if (ret < 0) goto out; + /* + * Change ALL virtual inodes with real-inodes in loc + */ if (dst->parent) { ret = inode_ctx_get (dst->parent, this, &value); if (ret < 0) { @@ -38,14 +41,9 @@ ga_valid_inode_loc_copy (loc_t *dst, loc_t *src, xlator_t *this) } inode_unref (dst->parent); dst->parent = inode_ref ((inode_t*)value); - /* if parent is virtual, no need to handle */ - /* loc->inode */ - goto out; + uuid_copy (dst->pargfid, dst->parent->gfid); } - /* if its an inode operation, on the virtual */ - /* directory inode itself, we need to handle */ - /* it properly */ if (dst->inode) { ret = inode_ctx_get (dst->inode, this, &value); if (ret < 0) { @@ -54,9 +52,10 @@ ga_valid_inode_loc_copy (loc_t *dst, loc_t *src, xlator_t *this) } inode_unref (dst->inode); dst->inode = inode_ref ((inode_t*)value); - goto out; + uuid_copy (dst->gfid, dst->inode->gfid); } out: + return ret; } |