Whamcloud - gitweb
LU-4604 obdclass: handle ldt_device_nr/ldt_linkage properly 31/12531/4
authorFan Yong <fan.yong@intel.com>
Wed, 3 Sep 2014 16:29:41 +0000 (00:29 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 4 Dec 2014 20:31:52 +0000 (20:31 +0000)
commit6158f83b1b17ee75e42f263e263a5d39ff8ca96f
tree7abaff5e946fa89b05d1d183213e6992b33f95e5
parent2ab8b98ea5dafbce59043e5d8477e794197116a0
LU-4604 obdclass: handle ldt_device_nr/ldt_linkage properly

It is partly back-ported the patch from master:
"LU-4604 lfsck: LFSCK async updates RPC flow control"
But this only contains the part related with lu_device fixes,
not the lfsck async RPC changes.

There was no protection when inc/dec lu_device_type::ldt_device_nr,
which may caused the ldt_device_nr to be wrong and trigger assert.
This patch redefine lu_device_type::ldt_device_nr as atomic type.

There was no protection when add/del lu_device_type::ldt_linkage
into/from the global lu_device_types list, which may caused bad
address accessing. This patch uses the existing obd_types_lock
to protect related operations.

We do NOT need lu_types_stop() any longer. Such function scans
the global lu_device_types list, and for each type item on it
which has zerod lu_device_type::ldt_device_nr, call its stop()
method. In fact, the lu_device_type::ldt_device_nr only will be
zero when the last lu_device_fini() is called, and at that time,
inside the lu_device_fini(), its stop() method will be called.
So it is unnecessary to call the stop() again via lu_types_stop().

Lustre-commit: caef708d4040fd13499a11a42507ba56f9454298
Lustre-change: http://review.whamcloud.com/8694

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: Ibea9e8f51191de76dbd2e199e01b1d2adff35c75
Reviewed-on: http://review.whamcloud.com/12531
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/include/lu_object.h
lustre/liblustre/llite_cl.c
lustre/llite/vvp_dev.c
lustre/obdclass/lu_object.c
lustre/obdclass/obd_mount.c