From 9813ff934f43d09ecbd60b9f73c624b04b7dcc77 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Thu, 24 Oct 2019 17:58:03 +0530 Subject: cluster/afr: Take a copy of xattr-req Afr adds its own xattrs to the req, so it should take a copy of the dictionary to prevent parent xlator re-using the modified xattr-req to another subvolume fixes: bz#1765155 Change-Id: I268e2dbd1b12323135d369e90a22a8bdde2cf7c2 Signed-off-by: Pranith Kumar K --- xlators/cluster/afr/src/afr-common.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'xlators') diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 951d8e7c81e..4b22af7cb3f 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -3274,10 +3274,15 @@ afr_discover(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) local->inode = inode_ref(loc->inode); - if (xattr_req) + if (xattr_req) { /* If xattr_req was null, afr_lookup_xattr_req_prepare() will allocate one for us */ - local->xattr_req = dict_ref(xattr_req); + local->xattr_req = dict_copy_with_ref(xattr_req, NULL); + if (!local->xattr_req) { + op_errno = ENOMEM; + goto out; + } + } if (gf_uuid_is_null(loc->inode->gfid)) { afr_discover_do(frame, this, 0); -- cgit