From 168142748d4f676071d9253bb536aec734a4a0da Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Tue, 22 Sep 2020 17:21:26 +0530 Subject: nfs: test case bugs_nfs_bug-1116503.t is crashed test case is crashed because GF_ASSERT is failing in gf_mem_set_acct_info function due to access global xlator instead of accessing nfs xlator.To avoid the crash pass nfsx at the time of calling nsm_thread to set the THIS. Fixes: #1506 Change-Id: Ifd8afcdf39578aa44332d1b79744a4e9910fe7c6 Signed-off-by: Mohit Agrawal --- xlators/nfs/server/src/nlm4.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xlators/nfs/server/src/nlm4.c') diff --git a/xlators/nfs/server/src/nlm4.c b/xlators/nfs/server/src/nlm4.c index c909e3bc093..577e8543966 100644 --- a/xlators/nfs/server/src/nlm4.c +++ b/xlators/nfs/server/src/nlm4.c @@ -1011,7 +1011,8 @@ nlm4_establish_callback(nfs3_call_state_t *cs, call_frame_t *cbk_frame) int port = -1; struct nlm4_notify_args *ncf = NULL; - glusterfs_this_set(cs->nfsx); + GF_ASSERT(cs->nfsx); + THIS = cs->nfsx; rpc_transport_get_peeraddr(cs->trans, NULL, 0, &sock_union.storage, sizeof(sock_union.storage)); @@ -2714,7 +2715,7 @@ nlm4svc_init(xlator_t *nfsx) goto err; } - (void)gf_thread_create(&thr, NULL, nsm_thread, (void *)NULL, "nfsnsm"); + (void)gf_thread_create(&thr, NULL, nsm_thread, nfsx, "nfsnsm"); timeout.tv_sec = nlm_grace_period; timeout.tv_nsec = 0; -- cgit