From 18f70e806bcef5a3680462a4dbb7061e5eceee1c Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Mon, 6 Apr 2020 21:58:03 +0530 Subject: 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 --- xlators/storage/posix/src/posix-helpers.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xlators/storage/posix/src') diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index 372df89807c..4c1da0ffa75 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, -- cgit