LU-4676 hsm: Fix return value error of ct_run()

ct_run() returns 0 after find out that fs_name is invalid.
lhsmtool_posix will exists with 0 after that error happens.
That might mislead scripts calling lhsmtool_posix.

Signed-off-by: Li Xi <lixi@ddn.com>
Change-Id: If167b38ffee0faff9d8eeb603c55b4972ba322d8
Reviewed-on: http://review.whamcloud.com/9412
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4817 osd: fix some leXX_to_cpu() usage issues

In osd fix some endianness conversion issues, like applying
le16_to_cpu() to an integer literal and calling le64_to_cpu() with a
32-bit value.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I5c4b9b0c6f5695e1c34f8deac25f8a0c5d547e23
Reviewed-on: http://review.whamcloud.com/9825
Tested-by: Jenkins
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4629 lov: fix sscanf format specification

sscanf format specification '%d' expects type 'int *' for 'd',
but parameter 3 has a different type '__u32*'

Length of format string "o%.5d" is 11 but array 'oname' of size 10.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I132ba4c4865cc12f831638edddb8d41e5fa2d273
Reviewed-on: http://review.whamcloud.com/9391
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-3953 build: fix AC_LANG_SOURCE autoconf warnings

This fixes several places where the autoconf rules generate the
following warning:

configure.ac:23: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE
call detected in body

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Change-Id: Ib6a54310853b1e9aa34155e8bec9aae410278f25
Reviewed-on: http://review.whamcloud.com/10158
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4951 scripts: report modules changes in dkms RPM config

lvfs.ko and nodemap.ko have been respectively removed and added
from/to distro, so this needs to be accordingly reported into
the script that generates DKMS RPM configuration statically.

Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: I917f79b134fb1d6be48b89c10faf531697fe1a9c
Reviewed-on: http://review.whamcloud.com/10090
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
LU-4952 osd: wrong paramters for dmu_tx_hold_write

osd_declare_write_commit may pass wrong parameters to
dmu_tx_hold_write when there are multiple IO fragments.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Change-Id: Ic7bd5ce1f42e7777c1a07eb4b9d19f8477da66a0
Reviewed-on: http://review.whamcloud.com/10079
Tested-by: Jenkins
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
LU-4849 lfs: Avoid double closedir() on err from cb_mv_init()

In cb_mv_init(), set *dirp to NULL if the parent cannot be opened.
This will avoid a double free when closedir() is called a second
time on the way out of llapi_semantic_traverse()

Signed-off-by: Swapnil Pimpale <spimpale@ddn.com>
Change-Id: I115137f01cd4e370f4ef766028ad9269e85ed10a
Reviewed-on: http://review.whamcloud.com/9905
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
LU-4934 tests: Account for slow ZFS in sanity-lfsck/9a-b

Allow lfsck speed to be too slow with ZFS due to it's performance
issues.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: Id39d9468327a02b648ba2c8b4b131250946a04b1
Reviewed-on: http://review.whamcloud.com/10140
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4681 utils: Fix error message when using hostname

When running llmount.sh for setting up and testing a filesystem
if the system does not have an accurate line in /etc/hosts the build
fails with a cryptic error message.

This patch adds a little more information to the error message
directing the admin to fix the /etc/hosts error.

Signed-off-by: Bobbie Lind <bobbie.j.lind@intel.com>
Change-Id: I426c1f05d2ab5dedc56bd587072882cf78c1bd43
Reviewed-on: http://review.whamcloud.com/9848
Tested-by: Jenkins
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4830 tests: only deactivate MDTs of Lustre FSNAME

Problem has been discovered using a very specific copytool Lustre
root/archive usage. All MDCs, including archive one, were
deactivated.

Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: I359e001e001b931e0a8ed773e0d476ffc3ea44db
Reviewed-on: http://review.whamcloud.com/9843
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4795 obd: Remove server_{get,put}_mount_2() functions

This patch fixes server_put_mount() to call server_deregister_mount()
only if the caller is never going to need the mount again. The only
caller of server_get_mount_2(), lustre_find_lwp_by_index(), is
changed to now call server_get_mount() and server_put_mount()
without calling server_deregister_mount().

Signed-off-by: Swapnil Pimpale <spimpale@ddn.com>
Change-Id: I37fd00bd477f946ac1bd8375da4899c2a1fe9e22
Reviewed-on: http://review.whamcloud.com/9749
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
LU-4629 osc: remove constant checks

Comparison of unsigned value against 0 is always true or false

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: Ib03cd9e401d006cce5a8a2f49220458941d2ef19
Reviewed-on: http://review.whamcloud.com/9348
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-4864 tests: cleanup shared files in sanity-hsm

Test creates shared files need to remove them completely

Signed-off-by: Minh Diep <minh.diep@intel.com>
Change-Id: Ib949326f18ddd3a508fd8605e16f3cafb5a9ee4d
Reviewed-on: http://review.whamcloud.com/10073
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2675 llapi: find_param cleanup part I

Add fp_ prefixes to several (dev,type,{u,g}id,{a,c,m}time,...,depth)
members of struct find_param. Remove the unused print_fmt
member. Remove the llapi internal arrays llapi_dir_filetype_table[]
and llapi_filetype_dir_table[] replacing their uses with IFTODT() and
DTTOIF().

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I0c24d8075493b814f3d3824f48b64d4b088928c5
Reviewed-on: http://review.whamcloud.com/10103
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-4629 ptlrpc: fix NULL pointer dereference of {exp,imp}_obd

Pointer 'obd' checked for NULL at line 694 may be dereferenced at
line 813.

Pointer 'req->rq_export->exp_obd' checked for NULL at line 1155
may be dereferenced at line 1164. Also there is one similar error
on line 1170.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I4e0d40bb634415a3f7f1a38f66139b89b9f97772
Reviewed-on: http://review.whamcloud.com/10062
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.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-4578 ptlrpc: Early replies need to honor at_max

When determining whether an early reply can be sent the server will
calculate the new deadline based on an offset from the request
arrival time. However, when actually setting the new deadline
the server offsets the current time. This can result in deadlines
being extended more than at_max seconds past the request arrival
time. Instead, the server should offset the arrival time when updating
its request timeout.

When a client receives an early reply it doesn't know the server side
arrival time so we use the original sent time as an approximation.

Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: I1b7b04bd20ea5d471ab3777f987e89add744b813
Reviewed-on: http://review.whamcloud.com/9100
Tested-by: Jenkins
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Christopher J. Morrone <chris.morrone.llnl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5002 flock: accept EDEADLK in sanityn test_74

In flocks_test.c t4() acquiring the second flock may legitimately fail
and return -EDEADLK. Handle this and ensure that errors encountered by
the child process are returned by the parent.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I55172add1412377b1c7125efa4177702d8bf1834
Reviewed-on: http://review.whamcloud.com/10208
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Andriy Skulysh <Andriy_Skulysh@xyratex.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>