LU-3118 lfsck: resume LFSCK from the last checkpoint

It is a misc patch to enable the support to resume LFSCK from the last
checkpoint: no object will be skipped, not repeatly scan the object(s)
in front of checkpoint.

Other fixes:
1) Simplify LFSCK checkpoint logic.
2) Add linkEA for .lustre itself, then LFSCK will not be misguided.
3) Set LFSCK status as "failed" if hit error at prepare phase.
4) osd_otable_it_store() should return the cursor position, instead
of the pre-load position.
5) Other code cleanup.

Test-Parameters: testlist=sanity-scrub,sanity-lfsck
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I3f6e988da323239ff2655ad4b13eae711e892ebe
Reviewed-on: http://review.whamcloud.com/6078
Tested-by: Hudson
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-3201 lmv: check result of lmv_find_target()

In lmv_locate_mds() and lmv_iocontrol() check the result of
lmv_find_target() using IS_ERR() before dereferencing it.  In
lmv_get_target() return ERR_PTR(-ENODEV) rather than NULL when the
indicated MDS cannot be found among the members of lmv->tgts.  In
__lmv_fid_alloc() check the result of lmv_get_target() using IS_ERR().

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I8cfce869e4be329fd432a7b6a88f48fbc81d69dd
Reviewed-on: http://review.whamcloud.com/6116
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: wangdi <di.wang@intel.com>
LU-3143 tests: pass correct facet to wait_osc_import_state()

This patch fixes recovery-small test 29a and some other tests
to pass correct facet to wait_osc_import_state(), which will
make the tests pass under failover configuration.

Test-Parameters: envdefinitions=SLOW=yes \
clientdistro=el6 serverdistro=el6 clientarch=x86_64 \
serverarch=x86_64 clientcount=4 osscount=2 mdscount=2 \
austeroptions=-R failover=true useiscsi=true \
testlist=recovery-small

Change-Id: I68b8d2f2528223a5140eed5724c2a4ffdd1988fa
Signed-off-by: Jian Yu <jian.yu@intel.com>
Reviewed-on: http://review.whamcloud.com/6100
Tested-by: Hudson
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-631 osc: wait OSC to complete initial connection with OST

in functions lov_prep_*_set, if one OSC isn't active and it is trying
its first connection with OST, then spend some time (obd_timeout)
to wait it to complete.

Change-Id: I424dbf81b6ceebf2cfd1cf48b0f89be40c4c3df4
Signed-off-by: Hongchao Zhang <hongchao.zhang@intel.com>
Reviewed-on: http://review.whamcloud.com/2469
Tested-by: Hudson
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Jeremy Filizetti <jeremy.filizetti@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>