staging/lustre: Make quota namespace refcounting consistent
authorOleg Drokin <green@whamcloud.com>
Mon, 22 Jul 2013 16:06:36 +0000 (00:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jul 2013 19:48:23 +0000 (12:48 -0700)
It seems quota namespace is needlessly referenced on connect,
but that's not necessary as it could not go away until entire
obd goes away.
On the other hand this extra reference disturbs other logic
depending on empty namespace having zero refcount, so this patch
drops such extra referencing.

This picks client side change of the original patch.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2924
Lustre-change: http://review.whamcloud.com/6234
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c

index 785c1a19da57d39c48507f2173bdddb999238014..bf6f00341a76811df8441608617572ab8f444e00 100644 (file)
@@ -84,8 +84,7 @@ static inline struct mutex *ldlm_namespace_lock(ldlm_side_t client)
                &ldlm_srv_namespace_lock : &ldlm_cli_namespace_lock;
 }
 
-/* ns_bref is the number of resources in this namespace with the notable
- * exception of quota namespaces which have their empty refcount at 1 */
+/* ns_bref is the number of resources in this namespace */
 static inline int ldlm_ns_empty(struct ldlm_namespace *ns)
 {
        return atomic_read(&ns->ns_bref) == 0;
index 716283859d72a92189edaca2eb437e38dff700c0..17eab79ba8394095cad4bda65c2e2a49f80b75d7 100644 (file)
@@ -1171,11 +1171,7 @@ ldlm_resource_get(struct ldlm_namespace *ns, struct ldlm_resource *parent,
        /* Let's see if we happened to be the very first resource in this
         * namespace. If so, and this is a client namespace, we need to move
         * the namespace into the active namespaces list to be patrolled by
-        * the ldlm_poold.
-        * A notable exception, for quota namespaces qsd_lib.c already took a
-        * namespace reference, so it won't be participating in all of this,
-        * but I guess that's ok since we have no business cancelling quota
-        * locks anyway */
+        * the ldlm_poold. */
        if (ns_is_client(ns) && ns_refcount == 1) {
                mutex_lock(ldlm_namespace_lock(LDLM_NAMESPACE_CLIENT));
                ldlm_namespace_move_to_active_locked(ns, LDLM_NAMESPACE_CLIENT);