LU-3335 scrub: OI scrub on OST

OI scrub should has the ability to handle kinds of OI, including
both the OI files on MDT and the /O directory on OST.

We trust the FID in LMA for both MDT objects and OST objects. So
if some /O sub-item does not match related LMA, then the /O will
be updated, instead of the LMA.

To guarantee that the OI scrub can run without MDT0 involved for
FLDB, the OST object needs to store some flag in its LMA to tell
OI scrub that it is for an OST object, no need to query the MDT0.

Test-Parameters: testlist=sanity-scrub
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I2da3816b28a7c6d5ad0b7f8d5b43f98a9886ff0c
Reviewed-on: http://review.whamcloud.com/6669
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
LU-3335 scrub: control OI scrub on OST from user space

Not all the OI inconsistency can be detected automatically, such as /O
entry lost case. So the OI scrub on OST should can be triggered by the
administrator manually.

Test-Parameters: testlist=sanity-scrub
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I9b23787b2fb14c8c93642462f9ebac948a181b70
Reviewed-on: http://review.whamcloud.com/6698
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>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3335 scrub: recover OST-objects from /lost+found

Originally, Lustre used the tool ll_recover_lost_found_objs to recover
orphans under /lost+found under offline mode. With OI scrub introduced
it can be done by initial OI scrub during the OST mount automatically.

Test-Parameters: testlist=sanity-scrub
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: Ibf7e51cc0de10def47a117217b84c2afcd1209ca
Reviewed-on: http://review.whamcloud.com/6857
Tested-by: Hudson
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3079 kernel: f_vfsmnt replaced by f_path.mnt

In linux 3.9 f_vfsmnt was killed and replaced

commit 182be684784334598eee1d90274e7f7aa0063616
Author: Al Viro <viro@zeniv.linux.org.uk>
Date:   Thu Jan 24 02:21:54 2013 -0500

    kill f_vfsmnt

    very few users left...

Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
Change-Id: I02f595f0b7bbe804c9695d6da2106deb2d17e0ee
Reviewed-on: http://review.whamcloud.com/5899
Tested-by: Hudson
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3514 tests: combine dependent sanity tests

The tests 27c, 77c, 77e, 77h are skipped when previous
dependent test is not ran.

This patch combines the following sanity tests:
    tests 27b, 27c to test 27b
    tests 77b, 77c to test 77b
    tests 77d, 77e to test 77d
    tests 77g, 77h to test 77g
For the 77* tests $tfile is used for test file name.

Signed-off-by: Elena Gryaznova <elena_gryaznova@xyratex.com>
Xyratex-bug-id: MRP-983
Signed-off-by: James Nunez <james.a.nunez@intel.com>
Change-Id: I945442326237f8ed5225f1b31bb06fac1b40f28e
Reviewed-on: http://review.whamcloud.com/6784
Tested-by: Hudson
Reviewed-by: Jian Yu <jian.yu@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3571 kernel: kernel update [SLES11 SP2 3.0.80-0.7]

Update of config and build files to new kernel version.

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: I5ded6caea683e88772955b0550700ced259ef641
Reviewed-on: http://review.whamcloud.com/6991
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Hudson
Reviewed-by: Minh Diep <minh.diep@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-1199 lbuild: Syntax fix of previous commit

A Change-Id: I68636f599937cec2ea9298a395df0c875762215e introduced
an error: ./lbuild: line 265: [: argument expected
Just fix this typo.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: Ieedfbd38f7f43684516ec3be00451984b57df4b8
Reviewed-on: http://review.whamcloud.com/7009
Reviewed-by: Christopher J. Morrone <chris.morrone.llnl@gmail.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3597 wireshark: Add new MDS opcodes

Add new HSM and other MDS opcodes.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: Idf888489ec66197053a2ba08c65289f119b1e144
Reviewed-on: http://review.whamcloud.com/7005
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2527 tests: add version check code to sanity test 183

This patch adds Lustre version check codes into sanity test
183 to make the test work with servers which do not have the
following patch:

Lustre-commit: ef75b59800d643e666d7c44c20287a8002e0a166
Lustre-change: http://review.whamcloud.com/4458

Test-Parameters: envdefinitions=SLOW=yes,ENABLE_QUOTA=yes,ONLY=183 \
clientdistro=el6 serverdistro=el6 clientarch=x86_64 \
serverarch=x86_64 serverjob=lustre-b2_1 serverbuildno=215 \
testlist=sanity

Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: I5de38207ed1a3a7d69294abf979dc64be69a8135
Reviewed-on: http://review.whamcloud.com/6994
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Hudson
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3364 tests: fix Lustre version number in sanity-lfsck.sh

The sanity-lfsck.sh was added by the following patch, which was included
since Lustre 2.3.60 instead of 2.2.90.

Lustre-commit: 21a9805abde3cbe1ffe046f2d9958d968303b8d3
Lustre-change: http://review.whamcloud.com/4911

Test-Parameters: envdefinitions=SLOW=yes,ENABLE_QUOTA=yes \
clientdistro=el6 serverdistro=el6 clientarch=x86_64 \
serverarch=x86_64 serverjob=lustre-b2_3 serverbuildno=41 \
testlist=sanity-lfsck

Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: I0f35b22409853852d8c7336e67f7b3661aa89f95
Reviewed-on: http://review.whamcloud.com/7019
Reviewed-by: Wei Liu <wei3.liu@intel.com>
Tested-by: Hudson
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3582 test: Add run_test to Runtests

There is no run_test in this script so add one
so logging in Autotest will greatly improve.
It seems some of the test is dependant so I did a
very minimal change to get the better logging.

Signed-off-by: Keith Mannthey <keith.mannthey@intel.com>
Change-Id: I2e892a39a48eb4020ab699cce9b83708800ebf58
Reviewed-on: http://review.whamcloud.com/7014
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-3589 tests: Access changelog record FIDs by name.

Update sanity test_160 to make it parse changelog records
in a more robust way. Access target and parent FIDs by name
instead of relying on their position on the line.

Signed-off-by: Henri Doreau <henri.doreau@cea.fr>
Change-Id: Ib5836a8e624f04a971b80f9ff9b9e978bbff7bee
Reviewed-on: http://review.whamcloud.com/6998
Tested-by: Hudson
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3079 osd-zfs: Change header order to avoid build fail

SPL redefined list_move_tail() in sys/list.h. It will
confused if system & lustre header use list_move_tail()
after SPL header.

Signed-off-by: yang sheng <yang.sheng@intel.com>
Change-Id: I946e810b57affdeedbfc16bb5e502ebde0716039
Reviewed-on: http://review.whamcloud.com/6968
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3517 llite: don't check for O_CREAT in it_create_mode

ll_lookup_it() checks for O_CREAT in struct lookup_intent's
it_create_mode member which is nonsensical, as it_create_mode is used
for file mode bits (S_IFREG, S_IRUSR, ...). Fix this by just checking
for IT_CREATE in it_op and do the same in llu_lookup_it(). This will
not affect the behavior of either function, since if O_CREATE (0100)
is actually set in o_create_mode then IT_CREATE must have been set in
it_op. In ll_atomic_open() check for O_CREAT in the open_flags
parameter rather than testing mode.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I301964222ec043e6f0cc3b000678fe3c881a2381
Reviewed-on: http://review.whamcloud.com/6786
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Peng Tao <bergwolf@gmail.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3310 tests: add version check code to sanity test 17o

This patch adds Lustre version check codes into sanity test
17o to make the test work with servers which do not have the
following patch:

Lustre-commit: 20544bd96269dbda51a76d31c2d09935637e8b2d
Lustre-change: http://review.whamcloud.com/6121

Test-Parameters: envdefinitions=SLOW=yes,ENABLE_QUOTA=yes,ONLY=17 \
clientdistro=el6 serverdistro=el6 clientarch=x86_64 \
serverarch=x86_64 serverjob=lustre-b2_1 serverbuildno=215 \
testlist=sanity

Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: I590a4fb03d6dd406ff1d859825f9033a24ceb66c
Reviewed-on: http://review.whamcloud.com/7017
Tested-by: Hudson
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3204 build: clean up unused variables and dead code

Clean up the code from really unused variables and rearrange other
to remove SET_BUT_UNUSED and UNUSED macro usage if possible.

Clean up or comment on some dead code.

Removed never implemented suspend timeouts functionality from pinger.c
which was commented out since 2007 and going to be replaced by adaptive
timeouts. Also removed all references to this functionality from
ldlm_lockd.c, ldlm_request.c and import.c which actually nevers executes
or do nothing.

 pinger.c commit d2d56f38da01001c92a09afc6b52b5acbd9bc13c
 Author: tappro <tappro>
 Date:   Mon Jul 30 21:08:59 2007 +0000
    - make HEAD from b_post_cmd3

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: Ned Bass <bass6@llnl.gov>
Change-Id: If7b6b3576d3ecc79948a7a1eb46a08c27a3bbc03
Reviewed-on: http://review.whamcloud.com/6139
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3405 build: fix 'control flow' errors

Fix 'control flow' issues found by Coverity version 6.5.1:
Logically dead code (DEADCODE)
Execution cannot reach this statement.
Missing break in switch (MISSING_BREAK)
This case is not terminated by a 'break' statement.
Stray semicolon (STRAY_SEMICOLON)
"if" statement with no "then" or "else" is suspicious.
Unsigned compared against 0 (NO_EFFECT)
This greater-than-or-equal-to-zero comparison of an unsigned value
is always true.

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: Ia737603bd9ef4dd6b01891b9b13edd59dec11891
Reviewed-on: http://review.whamcloud.com/6466
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3389 build: Fix build fails on RHEL6.4 kernel with OFED-3.5

OFED-3.5.1 supports RHEL6.4 kernel. CONFIG_COMPAT_RHEL_6_4 macro
needs to build lustre with them.

Signed-off-by: Shuichi Ihara <sihara@ddn.com>
Change-Id: Id64aeedecd7b034fbf618c41f774852c967e6eb7
Reviewed-on: http://review.whamcloud.com/6448
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3627 quota: Fix incorrect NULL return value of qsd_init()

qsd_init() might return NULL in some cases, which is not correct and
may make kernel crash. This patch fixes this problem.

Signed-off-by: Li Xi <lixi@ddn.com>
Change-Id: I604077f2f9143e500badb5148a6f0d9a246e375f
Reviewed-on: http://review.whamcloud.com/7100
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3427 build: fix 'error handling' issues

Fix 'error handling' issues found by Coverity version 6.5.1:
Unchecked return value (CHECKED_RETURN)
Calling function without checking return value.

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: I67d667b405f292604290a49e69c963500d98278e
Reviewed-on: http://review.whamcloud.com/7103
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobbie Lind <bobbie.j.lind@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>