LU-4119 ldlm: abort recovery by time_hard

Set obd_abort_recovery to 1 when recovery time
reaches obd_recovery_time_hard.

Xyratex-bug-id: MRP-1365

Change-Id: Ida8f71cb63d5db9bf85bcdf2c152b4d9f71b8bca
Signed-off-by: Sergey Cheremencev <Sergey_Cheremencev@xyratex.com>
Reviewed-on: http://review.whamcloud.com/9078
Tested-by: Jenkins
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5861 lnet: invoke lnetctl properly from startup script

Use the correct lnetctl command syntax to load default config:
lnetctl import < lnet.conf

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Change-Id: I54dd0d34f75b91c1c6ceb9745d817cb43f82ef25
Reviewed-on: http://review.whamcloud.com/12561
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5878 lfs: migrate file to its proper destination

llapi_file_open_param() is supposed to be returning the opened file
descriptor. However, when llapi_search_ost() is called, it returns 1,
which sets rc to 1, which in turn is confused for an error later, and
returned to the caller. So when the copy happen, the destination file
descriptor is 1 (stdout).

Fixed a typo in the function description, and format the parameters
descriptions.

Fixed a bad indentation.

There's no need to test lum before freeing it since at that point is
not NULL (and free will test it anyway).

Change-Id: I16fe26480b880aa818b1bb706b22bfdd6833d69c
Signed-off-by: frank zago <fzago@cray.com>
Reviewed-on: http://review.whamcloud.com/12601
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Henri Doreau <henri.doreau@cea.fr>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
LU-4820 osd: drop memcpy in zfs osd

dmu_read() was called from osd_read_prep() copying from
ARC bufs into the same ARC bufs. seem to be the remainings
of per-zerocopy age.

Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Change-Id: I0f3657c360d8541d7c3c6e8e32eac78bc5702b42
Reviewed-on: http://review.whamcloud.com/9760
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3456 ptlrpc: quiet errors on initial connection

It may be that a client or MDS is trying to connect to a target (OST
or peer MDT) before that target is finished setup.  Rather than
spamming the console logs during initial connection, only print a
console error message if there are repeated failures trying to
connect to the target, which may indicate an error on that node.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: I98ec7b4c2109b700b53297038d3fede4773ebbe5
Reviewed-on: http://review.whamcloud.com/10057
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5622 tests: check/wait for copytool death

Seems that copytool death/kill may take more time so
this condition must be handled in sanity-hsm copytool_cleanup()
function to avoid situations where copytool will then not be
restarted, but only signaled, in next copytool_setup().

Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: Ia72ed07f0219cf0aa2ef5b3805fb1f7faf4dab66
Reviewed-on: http://review.whamcloud.com/11922
Reviewed-by: Henri Doreau <henri.doreau@cea.fr>
Tested-by: Jenkins
Reviewed-by: Robert Read <robert.read@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2675 md: remove unused code from md_object.h

Remove several unused functions, structures, and members from
md_object.h.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I33de0ba987bfde95172e9bfb77929b6b4dcd0aa8
Reviewed-on: http://review.whamcloud.com/12113
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2675 lmv: remove lmv_init_{lock,unlock}()

In struct lmv_obd rename the init_mutex member to
lmv_init_mutex. Remove the compat macros lmv_init_{lock,unlock}() and
use mutex_{lock,unlock}(&lmv->lmv_init_mutex) instead.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Iae1f5d6b7fd1f96ba430d5e7af97c51ce3e042a8
Reviewed-on: http://review.whamcloud.com/12115
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2675 lnet: remove ulnds

Remove the unused userspace LND code (all of lnet/ulnds/) and
supporting autocrud.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I104d8b22afdde5027a2a0ef1a9ecc0423b67fae5
Reviewed-on: http://review.whamcloud.com/12117
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5687 dt: propagate errors from failed declarations

Check for and return errors from dt_declare_*() in several locations.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Id18b12d6c713e78e2f1cc782ff659d2c84cc60bb
Reviewed-on: http://review.whamcloud.com/12130
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5635 llog: prevent out-of-bound index

llog_process_thread() can be called from llog_cat_process_cb with an
index already out of bound, leading to the following crash:

LustreError: 3773:0:(llog.c:310:llog_process_thread())
  ASSERTION(index <= last_index + 1 ) failed:
LustreError: 3773:0:(llog.c:310:llog_process_thread()) LBUG

 #0 [ffff8801144bf900] machine_kexec at ffffffff81038f3b
 #1 [ffff8801144bf960] crash_kexec at ffffffff810c5d82
 #2 [ffff8801144bfa30] panic at ffffffff8152798a
 #3 [ffff8801144bfab0] lbug_with_loc at ffffffffa02f8eeb [libcfs]
 #4 [ffff8801144bfad0] llog_process_thread at ffffffffa0413fff [obdclass]
 #5 [ffff8801144bfb80] llog_process_or_fork at ffffffffa041585f [obdclass]
 #6 [ffff8801144bfbd0] llog_cat_process_cb at ffffffffa0418612 [obdclass]
 #7 [ffff8801144bfc30] llog_process_thread at ffffffffa0413c22 [obdclass]
 #8 [ffff8801144bfce0] llog_process_or_fork at ffffffffa041585f [obdclass]
 #9 [ffff8801144bfd30] llog_cat_process_or_fork at ffffffffa0416b9d [obdclass]
    RIP: 00007f6de5e4f730  RSP: 00007fff9aa26d98  RFLAGS: 00000206
    RAX: 0000000000000000  RBX: ffffffff8100b072  RCX: 00007f6de5e4f730
    RDX: 0000000000008000  RSI: 00000000019c7000  RDI: 0000000000000003
    RBP: 00000000019c7000   R8: 00007f6de6103ee8   R9: 0000000000000001
    R10: 00007fff9aa26b20  R11: 0000000000000246  R12: ffffffffffff8000
    R13: 0000000000000003  R14: 0000000000008000  R15: 0000000000000003
    ORIG_RAX: 0000000000000000  CS: 0033  SS: 002b

If index is too big, simply return success.

Change-Id: I81bbedbbe2bcef478c370ef40fc069447d39efbd
Signed-off-by: frank zago <fzago@cray.com>
Reviewed-on: http://review.whamcloud.com/12161
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5808 llog: check name strictly to avoid invalid record

Records for a file system cound be written to llog of another file
system by mistake if the name of the former one is the prefix of
the latter one. This patch fixes the problem by using more strict
checking of llog name.

Signed-off-by: Li Xi <lixi@ddn.com>
Change-Id: If45c59b0226b71e8a95f9aa719eae8412c89a2f1
Reviewed-on: http://review.whamcloud.com/12437
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
LU-5894 mds: allow 2.4/2.5 clients create remote dir

MDS will only return ENOTSUPP if old client (2.4/2.5) tries
to create striped dir with stripe count > 1, so it can still
create remote directory on the new MDS (>= 2.6).

Change-Id: I25c90ae793f91eed032949d26fd5e7fc41801e4f
Signed-off-by: Wang Di <di.wang@intel.com>
Reviewed-on: http://review.whamcloud.com/12715
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
LU-5912 libcfs: use vfs api for fsync calls

Use vfs_fsync_range() instead of direct use of filp->f_op->fsync()
routines.  Doing so will apply correct locking transparently without
needing to decide how to do it ourselves.
What we were doing was a long term violation of the locking
protocols described in Documentation/filesystems/Locking in linux
source but was never noticed until new checking code went into the
RHEL 6.6 kernel.  The new check triggered a visible error in syslog.

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: I551215fc340637364fe04f6e3bae963cf983c953
Reviewed-on: http://review.whamcloud.com/12731
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-5950 mgc: add nid iteration

mgc_apply_recover_logs use only first nid from entry,
this could be the problem for a cluster with several network
address for a one node.

Signed-off-by: Alexander Boyko <alexander.boyko@seagate.com>
Change-Id: I6ec348761c2d51edd613cb388e37ef7776990424
Xyratex-bug-id: MRP-2255
Reviewed-on: http://review.whamcloud.com/12829
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Ann Koehler <amk@cray.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
LU-5951 clio: update timestamps after buiding rpc

The mtime/atime/ctime in the write RPC has to be updated after
the RPC is built (where xid is generated), otherwise, it could
race with the setattr and updating wrong timestamps on OST side.

Seems this regression was introduced when landing clio code.

Use ofd_write_lock() to protect fmd lookup/udpate in
ofd_punch_object(), otherwise, it could race with ofd_attr_set()
and ofd_commitrw().

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I16216038ea2bd064ef7f33857a1d4aba167ac5fb
Reviewed-on: http://review.whamcloud.com/12865
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
LU-5586 llite: fix dup flags names

The name 'xattr' is used for two different ll_flags bits.
Change the names to be distinct and different, reflecting
the names of the bits used in LL_SBI_xbitnamex #defines.

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: I538cbee8f5382e1a7c74f2dcd598025886225cc3
Reviewed-on: http://review.whamcloud.com/12892
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5857 tests: check lctl return value in check_catastrophe()

This patch fixes check_catastrophe() to check the return value of
lctl command. The catastrophe value would be checked only if the
lctl command passed.

The patch also simplifies the function to check catastrophe value
on all of the test nodes without separating local and remote nodes.

Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: I0ffdafe27b0829dde5a8ea136be76e35b5ea8f43
Reviewed-on: http://review.whamcloud.com/12640
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5702 ldlm: suppress error message for valid case

LVB object may not exist and this is valid case

Signed-off-by: Mikhail Pershin <mike.pershin@intel.com>
Change-Id: I673933d582856a212289e228f0ccfb156c88cfb1
Reviewed-on: http://review.whamcloud.com/12189
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Li Wei <wei.g.li@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
LU-5536 target: allow FLD_READ request during recovery

FLD_READ opcode was introduced but not added to the
tgt_filter_recovery_request() as allowed during recovery.

Signed-off-by: Mikhail Pershin <mike.pershin@intel.com>
Change-Id: I1d63a95202288e3d72b77037658e5ba0eec4103e
Reviewed-on: http://review.whamcloud.com/12199
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>