summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawal@redhat.com>2020-04-06 21:58:03 +0530
committerMOHIT AGRAWAL <moagrawa@redhat.com>2020-04-09 04:26:28 +0000
commit18f70e806bcef5a3680462a4dbb7061e5eceee1c (patch)
treeac9efa23820f6bee58aafbc171a85f6bbd6af490 /xlators/storage/posix/src
parent9115dd39e953953495d48c6d6f24f44828f8bd5f (diff)
posix: Avoid dict_del logs in posix_is_layout_stale while key is NULL
Problem: The key "GF_PREOP_PARENT_KEY" has been populated by dht and for non-distribute volume like 1x3 key is not populated so posix_is_layout stale throw a message while a file is created Solution: To avoid a log put a condition before delete a key Change-Id: I813ee7960633e7f9f5e9ad2f42f288053d9eb71f Fixes: #1150 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src')
-rw-r--r--xlators/storage/posix/src/posix-helpers.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
index 372df89..4c1da0f 100644
--- a/xlators/storage/posix/src/posix-helpers.c
+++ b/xlators/storage/posix/src/posix-helpers.c
@@ -3510,13 +3510,14 @@ posix_is_layout_stale(dict_t *xdata, char *par_path, xlator_t *this)
op_ret = dict_get_str_sizen(xdata, GF_PREOP_PARENT_KEY, &xattr_name);
if (xattr_name == NULL) {
op_ret = 0;
- goto out;
+ return is_stale;
}
arg_data = dict_get(xdata, xattr_name);
if (!arg_data) {
op_ret = 0;
- goto out;
+ dict_del_sizen(xdata, GF_PREOP_PARENT_KEY);
+ return is_stale;
}
size = sys_lgetxattr(par_path, xattr_name, value_buf,