From bdcb2d8497d77ff28cb031ae3992eb7ea0c90486 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Mon, 3 Dec 2018 11:23:20 -0500 Subject: features/snapview-client: access priv->path inside lock To handle the race condition of a fop or a function accessing priv->path and a reconfigure changing priv->path (because entry point directory changed), the private structure's path is guarded by the lock. updates bz#1650403 Change-Id: I61c539da06d68d38eafcf2155699c7702f31323e Signed-off-by: Raghavendra Bhat --- xlators/features/snapview-client/src/snapview-client.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xlators/features/snapview-client/src/snapview-client.h') diff --git a/xlators/features/snapview-client/src/snapview-client.h b/xlators/features/snapview-client/src/snapview-client.h index 00caa0988c7..166116a439d 100644 --- a/xlators/features/snapview-client/src/snapview-client.h +++ b/xlators/features/snapview-client/src/snapview-client.h @@ -39,8 +39,8 @@ typedef struct __svc_local svc_local_t; svc_local_free(__local); \ } while (0) -#define SVC_ENTRY_POINT_SET(this, xdata, op_ret, op_errno, new_xdata, priv, \ - ret, label) \ +#define SVC_ENTRY_POINT_SET(this, xdata, op_ret, op_errno, new_xdata, ret, \ + label) \ do { \ if (!xdata) { \ xdata = new_xdata = dict_new(); \ @@ -81,6 +81,7 @@ struct svc_private { char *path; char *special_dir; /* needed for samba */ gf_boolean_t show_entry_point; + gf_lock_t lock; /* mainly to guard private->path */ }; typedef struct svc_private svc_private_t; -- cgit