Whamcloud - gitweb
LU-7524 fld: fld_clientlookup retries next target 83/17683/4
authorNoopur Maheshwari <noopur.maheshwari@seagate.com>
Thu, 28 Jan 2016 17:28:49 +0000 (22:58 +0530)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 14 Mar 2016 02:40:24 +0000 (02:40 +0000)
commit8d4ef45e078010d98f5c4f786e551d487f3e6e18
treeb450e16bd0232b1f43a9d42abaf304fd47fa014f
parent9a0a5eb8f94a1874dde0f7813eabb577cf21d3ff
LU-7524 fld: fld_clientlookup retries next target

fld_client_lookup() retries for another target, if the remote
target is deactive. This was introduced in
http://review.whamcloud.com/#/c/14313/ For getting the
next export target from the list, we use:
target = list_entry(target->ft_chain.next, struct
lu_fld_target,ft_chain);

Now for tests that deactivate the last target,
&(target->ft_chain) is the last entry in the list, and the
next of the last entry(target->ft_chain.next) is the list_head.
Using the macro list_entry maps the list_head pointer back into
a pointer to the structure that contains the list_head. Thus,
it turns the head of the list into its containing
structure(lu_fld_target).
Hence, since the head of the list does not have any data
associated with it, the containing structure(i.e.target)
formed from the head of the list also does not have any data.
Therefore, an export target with no obd device data is generated.
This corrupted export target(generated from the head of the
list) causes the assertion.

The fix is: While fld_client_lookup retries for another target,
if the next entry in the export target list is the head of the
list(&fld->lcf_targets), move to the next entry after the
head(target->ft_chain.next->next) and retrieve the target.
Else retrieve the next target entry(target->ft_chain.next).

Seagate-bug-id: MRP-3200
Signed-off-by: Noopur Maheshwari <noopur.maheshwari@seagate.com>
Change-Id: Ia353437a315de0f1bb44d8822e836ac969b0567f
Reviewed-on: http://review.whamcloud.com/17683
Tested-by: Jenkins
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/fld/fld_request.c