LU-2053 crypto: Fix cfs_crypto_hash memleak

Commit 353e3c2f8d9f195c0f87a16259f22b2f84de11d4 that introduced cryptoapi
support to Lustre is allocating a hdesc in cfs_crypto_hash_init and never
freeing it.
This function is called every time a checksum needs to be calculated,
so on every bulk RPC send or receive, so even though allocations are small,
they tend to still quickly consume all available memory with any significant
amount of IO.

Change-Id: Ic654c6102ea4306a81c1f7592c81cfb6e597f1f2
Signed-off-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/4135
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alexander Boyko <alexander_boyko@xyratex.com>
LU-1867 tests: replay-single test_89: @@ FAIL: 4 blocks leaked

The config llog data will changed while OST remount. It may
impact 'df' output. So we should allow extra one block size
different(4k).

Signed-off-by: Yang Sheng <ys@whamcloud.com>
Change-Id: I663685d55a5a31af48d541e08e9e97fed2b8e25c
Reviewed-on: http://review.whamcloud.com/4130
Tested-by: Hudson
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-1753 test: use large resend count for 118i in sanity

in sanity.sh, the subtest 118i will fail if the resend count
of OSC is small for 'SLOW=no' case (it's 4, default is 10).

Signed-off-by: Hongchao Zhang <hongchao.zhang@whamcloud.com>
Change-Id: I3c49628ed259e7adbff4a100d482e693502bf99d
Reviewed-on: http://review.whamcloud.com/4071
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1783 tests: skip directory atime update test in SLES11 SP1

Since this failure is seen only in SP1 which is already out of support,
skipping the subtest for this sles version.

Test-Parameters: clientdistro=sl11

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: I9f996b1e9955052b46ad7e3310e21f118bfa77cf
Reviewed-on: http://review.whamcloud.com/4062
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-2024 tests: skip OI scrub tests until the tag 2.2.90

Do not trigger OI scrub related tests on old releases.

Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Change-Id: I9a4289b03ee8e222329b69891bb901fff9fbc86d
Reviewed-on: http://review.whamcloud.com/4089
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1870 utils: correctly handle mount of multipath devices

The mount.lustre command had lost the correct handling of multipath
devices. When one is specified, an entry is added into /etc/mtab
using the device name: /dev/mapper/mpathXX. This ensures unmount
works fine with such devices.

Signed-off-by: Gregoire Pichon <gregoire.pichon@bull.net>
Change-Id: I9060be882af944967a8c4b6b1c4403ea9250ad55
Reviewed-on: http://review.whamcloud.com/3922
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-2040 tests: interop test failure on mds-survey

Add a version check to skip mds-survey in interop testing.
This is known to fail and should not block testing.

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: I4d1ef336cecf525d7df54816cb9731ec6c6edd91
Reviewed-on: http://review.whamcloud.com/4124
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
LU-2056 mdd: create transaction before lock object

OSD requires create transaction handle before lock the object,
however, mdd_close has a rare path can violate this rule.
This patch also did some code cleanup for mdd_close().

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: I2610acdc7ac4bbf6f22a9714db96b08ee430a613
Reviewed-on: http://review.whamcloud.com/4152
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1842 oi: handle failure cases for osd_oi_fini

Sometimes the osd_oi_fini() may be called without osd_oi_init()
called firstly, or with osd_oi_init() failure. Under such cases,
the osd_device::od_oi_table may be invalid, so just skip related
OI cleanup.

Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Change-Id: I67156acbe235287e8fc98606b0449998ef6f9dd0
Reviewed-on: http://review.whamcloud.com/4218
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Liang Zhen <liang@whamcloud.com>
Tested-by: Hudson
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-1898 test: new tests 8[a,b,c,d,e] need 2.3 or later

check lustre version to make sure tests do not run
on unsupported version

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: I5b284af44a6132070b8e89659b7981844a74555e
Reviewed-on: http://review.whamcloud.com/3986
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1951 mdd: fix for error handler of mdd_rename

If mdd_rename() failed to unlink target file/dir, it will try to
revert everything including insert target file/dir back into target
directory, but it didn't restore nlink count of target, which will
leave a file/dir under target directory with wrong nlink number.

Another thing is fixed by this patch is, mdd_attr_check_set_internal()
didn't release mdd_write_lock() while jumping to error handler.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: I18776a8415933a1ce125f91a96deb11436057ec9
Reviewed-on: http://review.whamcloud.com/4197
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-2041 oi: keep oi mapping cache consistency

Sometimes the local ID of the per RPC thread OI mappig cache may be
changed, but the FID of such OI mapping cache has not been updated,
which will cause the RPC thread finds some unexpected object with
the given FID, should be fixed.

Move osd_device::osd_scrub::os_no_scrub to osd_device::od_noscrub.

Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Change-Id: Idbc46cd70b136b7ffc2528331d5593fbac725900
Reviewed-on: http://review.whamcloud.com/4207
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Liang Zhen <liang@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Lustre 2.3.0-RC2

Change-Id: Ifd2f0dfbc6cd5f56a4ec29564c403e1b42279d9f
LU-2144 utils: reset 'optind' to avoid segmentation fault

Sometimes lfsck_{start,stop} commands may be called several
times under the same lctl shell. Under such case, the function
getopt_long() called inside the lfsck_start/lfsck_stop may be
confused, and cause segmentation fault. So reset the external
variable 'optind' by force to avoid the segmentation fault.

Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Change-Id: I90c13226101af34948e45959b55752123e77fc9f
Reviewed-on: http://review.whamcloud.com/4251
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-2142 scrub: reset completed scrub position if retrigger

If former OI scrub has been completed, and the user wants to run
the OI scrub again, then reset the OI scrub to make it to rescan
the device from the beginning.

Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Change-Id: I9b067f50df81461702c7f3db0eadd2bf3ebf5699
Reviewed-on: http://review.whamcloud.com/4252
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-2163 lprocfs: fix jobstats initialization race

If two threads are racing to add the same jobid into the job stats
list in lprocfs_job_stats_log(), one thread will lose the race from
cfs_hash_findadd_unique() and enter the "if (job != job2)" case.  It
could fail LASSERT(!cfs_list_empty(&job->js_list)) depending whether
the other thread in "else" added "job2" to the list first or not.

Simply locking the check for cfs_list_empty(&job->js_list) is not
sufficient to fix the race.  There would need to be locking over the
whole cfs_hash_findadd_unique() and cfs_list_add() calls, but since
ojs_lock is global for the whole OST this may have performance costs.

Instead, just remove the LASSERT() entirely, since it provides no
value, and the "losing" thread can happily use the job_stat struct
immediately since it was fully initialized in job_alloc().

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Iecb17e2dc80621fd388295998df5708bcaabcab0
Reviewed-on: http://review.whamcloud.com/4263
Tested-by: Hudson
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1833 util: don't update mtab if linked to /proc

Some distros may link /etc/mtab to /proc/mounts, or
/proc/self/mounts.  In such case, we don't need to
update mtab. Otherwise we false alart user with
"
mount.lustre: addmntent: Invalid argument:
"

Signed-off-by: Peng Tao <tao.peng@emc.com>
Change-Id: I2e3e213e4ee3bc177865c4ca7435a7eecd274b46
Reviewed-on: http://review.whamcloud.com/3881
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
New tag 2.3.0-rc3

Change-Id: Idf690e5fa0aa618b07594b7fdf5eb1d66fc6af9c
Signed-off-by: Oleg Drokin <green@whamcloud.com>
Merge remote branch 'upstream/b2_3' into b2_3-krb