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)
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

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
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>

index 21ce719..9354922 100644 (file)
@@ -499,8 +499,13 @@ again:
                 * then try next target in the list, until trying all targets
                 * or fld lookup succeeds */
                 * then try next target in the list, until trying all targets
                 * or fld lookup succeeds */
-               if (target->ft_chain.next == fld->lcf_targets.prev)
-                       target = list_entry(fld->lcf_targets.next,
+               /* If the next entry in the list is the head of the list,
+                * move to the next entry after the head and retrieve
+                * the target. Else retreive the next target entry. */
+               if (target->ft_chain.next == &fld->lcf_targets)
+                       target = list_entry(target->ft_chain.next->next,
                                            struct lu_fld_target, ft_chain);
                        target = list_entry(target->ft_chain.next,
                                            struct lu_fld_target, ft_chain);
                        target = list_entry(target->ft_chain.next,