LU-2833 tests: Unexempt sanity/48a for zfs

With LU-2449 being landed this test no longer fails on ZFS.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: Ie82f25ac0152dee7972a8a210d8669b59798e9a7
Reviewed-on: http://review.whamcloud.com/12607
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5507 recovery: don't replay closed open

To avoid scanning the replay open list every time in the
ptlrpc_free_committed(), the fix of LU-2613 (4322e0f9) changed
the ptlrpc_free_committed() to skip the open list unless the
import generation is changed. That introduced a race which could
make a closed open being replayed:

1. Application calls ll_close_inode_openhandle()-> mdc_close(),
   to close file, rq_replay is cleared, but the open request is
   still on the imp_committed_list;

2. Before the md_clear_open_replay_data() is called for close,
   client start replay, and that closed open will be replayed
   mistakenly;

3. Open replay interpret callback (mdc_replay_open) could race
   with the mdc_clear_open_replay_data() at the end;

This patch fix the ptlrpc_free_committed() to make sure the
open list is scanned on recovery to prevent the closed open request
from being replayed.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: Ia67fe5d8d501a69bafbbd7e44bd612abb9c254c6
Reviewed-on: http://review.whamcloud.com/12667
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5727 ldlm: revert the changes for lock canceling policy

The changes for LRU lock policy was introduced by commit bfae5a4e,
where I was trying to revise the policy to pick locks for canceling.

However, this caused two problems as mentioned in LU-5727. The first
problem is that the lock can only be picked for canceling only if
the number of LRU locks is over preset LRU number AND it's aged; the
second problem is that mdc_cancel_weight() tends to not cancel OPEN
locks, therefore open locks can be kept forever and finally exhausts
memory on the MDT side.

The first problem is fixed by patch e8812867. This patch will revert
the rest of changes related to LRU policy revise.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: Ie1dbcd15dc6e739d01ddcae01d7e637688a1d4b2
Reviewed-on: http://review.whamcloud.com/12733
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5963 nodemap: use proper hashing

don't hash a export pointer as string.
check a situation when we don't delete a export from nodemap
hash.

Signed-off-by: Alexey Lyashkov <alexey_lyashkov@xyratex.com>
Change-Id: Id53281078f165ce984abebc74992bde30fcc9f31
Reviewed-on: http://review.whamcloud.com/12881
Tested-by: Jenkins
Reviewed-by: Andrew Perepechko <andrew_perepechko@xyratex.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Kit Westneat <kit.westneat@gmail.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5867 lfsck: Enable --create_mdtobj flag

Using the --create_mdtobj flag in 'lctl lfsck_start'
creates an error. "create_mdtobj" is added to the
option struct so it will be recognized as a valid option.

When displaying the results of LFSCK, "create_mdtobj" is
not listed as a parameter. "create_mdtobj" is added to
the lfsck_param_names array so it will be printed when
used.

Also, added LSV_CREATE_MDTOBJ to the lfsck_request
valid options/flags.

Signed-off-by: James Nunez <james.a.nunez@intel.com>
Change-Id: I1923bb9a71958b390b9abea248b328ac59c3caad
Reviewed-on: http://review.whamcloud.com/12578
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-1452 scrub: OI scrub skips uninitialized groups

If the ldiskfs group descriptor is marked as LDISKFS_BG_INODE_UNINIT,
then means that the inodes in such group have never been initialized,
so the otable based iterator can skip this group directly to speed up
the scanning.

If the iteration position reaches the unused inodes area in the
group descriptor (indicated by bg_itable_unused), then skip the
rest inodes in this group to reduce the scanning time.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: Ie8a2eb1269d288865ce51d40e211e3db54d062af
Reviewed-on: http://review.whamcloud.com/12737
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
LU-1453 scrub: auto trigger OI scrub more flexible

Generally, scanning the whole device for OI scrub routine check may
takes some long time. If the whole system only contains several bad
OI mappings, then it is not worth to trigger OI scrub automatically
with full speed when some bad OI mapping is auto-detected. Instead,
we can make the OI scrub to fix the found bad OI mappings only, and
if more and more bad OI mappings are found as to exceeds some given
threshold that can be adjusted via some proc interface, then the OI
scrub will run with full speed to scan whole device.

Currently, we offer two kinds of thresholds for triggering OI scrub
to scan the whole device:

1) "the total OI mappings count" vs "the bad OI mappings count".
   If such ratio is low than the given threshold that can be set
   via the proc interface "full_scrub_ratio", then trigger urgent
   mode OI scrub.

2) "the speed of found the bad OI mappings". If the speed exceeds
   the given threshold that can be adjusted via the proc interface
   "full_scrub_speed", then trigger urgent mode OI scrub.

Test-Parameters: mdsfilesystemtype=ldiskfs mdtfilesystemtype=ldiskfs \
ostfilesystemtype=ldiskfs envdefinitions=ONLY=4 testlist=sanity-scrub
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: Ibc4592fef1da11994ec30eb348d20576be5ae54b
Reviewed-on: http://review.whamcloud.com/12738
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>