From: James Simmons Date: Mon, 8 Jul 2019 20:47:40 +0000 (-0400) Subject: LU-12491 obdclass: add comment for rcu handling in lu_env_remove X-Git-Tag: 2.12.56~26 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F47%2F35447%2F4;p=fs%2Flustre-release.git LU-12491 obdclass: add comment for rcu handling in lu_env_remove During the review it was pointed out why the RCU lock was dropped in lu_env_remove() but the code itself doesn't explain why. Add a comment giving the details why RCU locking is not needed. Test-parameters: trivial Change-Id: I4fd761d2e1b4adad8e970904d56cdcd057dfe7d5 Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/35447 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo Reviewed-by: Shaun Tancheff Reviewed-by: Neil Brown Reviewed-by: Oleg Drokin --- diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c index e308851..519ef62 100644 --- a/lustre/obdclass/lu_object.c +++ b/lustre/obdclass/lu_object.c @@ -1948,6 +1948,11 @@ void lu_env_remove(struct lu_env *env) } } + /* The rcu_lock is not taking in this case since the key + * used is the actual task_struct. This implies that each + * object is only removed by the owning thread, so there + * can never be a race on a particular object. + */ lei = rhashtable_lookup_fast(&lu_env_rhash, &task, lu_env_rhash_params); if (lei && rhashtable_remove_fast(&lu_env_rhash, &lei->lei_linkage,