Whamcloud - gitweb
LU-6173 llite: allocate and free client cache asynchronously 46/13746/4
authorEmoly Liu <emoly.liu@intel.com>
Fri, 13 Feb 2015 02:15:48 +0000 (10:15 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 3 Mar 2015 17:20:45 +0000 (17:20 +0000)
commit302c5bfebe61e988dbd27063becc4ef90befc6df
treeb48b86baaf37e2f5a7a3f47025e0f76b4a96aced
parent2267fc79d94dea3778cb4600027698e0155f1af3
LU-6173 llite: allocate and free client cache asynchronously

Since the inflight request holds import refcount as well as export,
sometimes obd_disconnect() in client_common_put_super() can't put
the last refcount of OSC import (e.g. due to network disconnection),
this will cause cl_cache being accessed after free.

To fix this issue, ccc_users is used as cl_cache refcount, and
lov/llite/osc all hold one cl_cache refcount respectively, to avoid
the race that a new OST is being added into the system when the client
is mounted.
The following cl_cache functions are added:
- cl_cache_init(): allocate and initialize cl_cache
- cl_cache_incref(): increase cl_cache refcount
- cl_cache_decref(): decrease cl_cache refcount and free the cache
  if refcount=0.

Also, the fix of LU-2543 is not needed anymore, so reverted.

Signed-off-by: Emoly Liu <emoly.liu@intel.com>
Change-Id: I22ff10b683b683d49d603e5dc2de3397746a79bb
Reviewed-on: http://review.whamcloud.com/13746
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/cl_object.h
lustre/include/obd.h
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/lproc_llite.c
lustre/lov/lov_obd.c
lustre/obdclass/cl_page.c
lustre/osc/osc_page.c
lustre/osc/osc_request.c