LU-499 grant/cancel_rate are static when OST is idle

ldlm_pool_recalc() shouldn't be skipped if namespace->ns_bref eqauls
zero, instead a flag ns_stopping is added to mark ldlm namespace is
being freed.

Signed-off-by: Lai Siyao <laisiyao@whamcloud.com>
Change-Id: Ic6485c34ec3e9868ae531a4dc25aee969c374eb5
Reviewed-on: http://review.whamcloud.com/1185
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Prakash Surya <surya1@llnl.gov>
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-795 osd api: Commit callback per transaction

- ability to add commit callback per transaction in addition to
  per-device hooks. Now it is much simpler if only commit callback
  is needed.
- rewrite commit callbacks for last_commit and new_client, add commit
  callback in seq manager
- cleanup not-needed code: old commit callbacks, txn_keys
- remove osd od_env_for_commit environment and env param from commit
  callbacks
- use th_sync to mark sync operations

Change-Id: If5f8f2a6d3cd2f3e77fd13c802213a181043a2d7
Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/1621
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-792 lbuild-rhel5 should use redhat's SRPM repo

Download EL5 kernel .src.rpm packages from redhat's repo instead
of trying to use CentOS's often-outdated repo.

Change-Id: I0e622e6481f11941b5038b36c0fd074fe470c595
Signed-off-by: Michael MacDonald <mjmac@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/1590
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Brian J. Murrell <brian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-651 osc: suppress message in can_merge_pages()

Thottle messages if adjacent brw pages are not mergeable with
different OBD_BRW_NOQUOTA flags.

Change-Id: I22ce6f8807e2541d3e6b3c9631f60faa36baa81a
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/1328
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-143 fid hash improvements

Current hash function of fid is not good enough for lu_site and
ldlm_namespace.
We have to use two totally different hash functions to hash fid into
hash table with millions of entries.

Change-Id: I6261e63a406118a93d578210c31e67fc7f9e389c
Signed-off-by: Liang Zhen <liang@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/374
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-543 mdd: fix rename changelog

Current rename changelog stores source fid in both CL_RENAME & CL_EXT
records, which is redundant, and the 'tfid' in CL_EXT is never been
used.

Actually, we'd store target fid in the CL_EXT record, then application
could detect the fid unlinked by rename in changelog.

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: I0c616f813657a2faefa60a707f4fc1d9dc971b39
Reviewed-on: http://review.whamcloud.com/1652
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mikhail Pershin <tappro@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1049 script: lc_net doesn't parse output correctly

Port the second fix from bz=23234
The output of ping contains two ip addresses. The regex
matching picks up both addresses. The fix is to add
-m 1 to stop at the first match
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Change-Id: Ie145e710844d80587bf6826822c8db941a4a3bae
Reviewed-on: http://review.whamcloud.com/2057
Reviewed-by: Cliff White <cliffw@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-482 test: sync MDS before first replay test

Maloo autotest system often fails on mountdata lost on MDS, the cause
may be related with LMV and hyporvisor usage. Sync MDS before first
replay to flush all files on MDS.

Signed-off-by: Lai Siyao <laisiyao@whamcloud.com>
Change-Id: I2c0fe37d77b05c81e567c70ef5bffca9eae84632
Reviewed-on: http://review.whamcloud.com/2545
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1280 ldiskfs: remove LASSERTF from ext3_ext_new_extent_cb()

The LASSERTF() in ext3_ext_new_extent_cb() was injected for
debugging purpose to make sure the race really happened but
was forgotten to be removed from the original patch in
http://review.whamcloud.com/1618 .

Signed-off-by: Yu Jian <yujian@whamcloud.com>
Change-Id: I978b8ab88cc4413c7ac00db838f7578f8011b192
Reviewed-on: http://review.whamcloud.com/2452
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
LU-1312 kernel: crash at boot time in isci driver

Restore SG_ALL to default value to avoid crash isci.

Signed-off-by: yang sheng <ys@whamcloud.com>
Change-Id: Ie20bbf669c64514fc95f1f2b274a689d65cd0c2a
Reviewed-on: http://review.whamcloud.com/2596
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-482 tests: abort replay-dual if test_0a fails

Due to repeated and annoying LU-482 failures of replay-dual.sh
test_0a, abort the whole test script if test_0a fails.  While this
is not ideal, it is better than disabling replay-dual.sh entirely.

Until bug TT-554 is fixed to display "SKIP" results from a test in
Maloo, we should still be able to detect the LU-482 failures because
replay-dual test will complete in a few seconds instead of thousands.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I4bc6b62e0028b908f0fc8afaab0030b0fcdf500c
Reviewed-on: http://review.whamcloud.com/2731
Tested-by: Hudson
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Reviewed-by: Li Wei <liwei@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-1205 tests: sanityn test_18 sometimes takes long time to run

This is a live-lock problem where two processes are writing to the
same mmaped file via two nodes. To write a mmap region, both processes
will do:

  acquire cl_lock -> read page -> release cl_lock-> install page.

During the above steps, the page can be truncated after the lock is
released and then immediately cancelled by the other process, so
kernel has to do page fault again and never complete.

Lustre can't handle this case well so this test case is disabled.

Signed-off-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Change-Id: I0c3fd5beab388cbed6193ae496d4d0e4f23be797
Reviewed-on: http://review.whamcloud.com/2544
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1280 ldiskfs: remove EXT_ASSERT from ext3_ext_new_extent_cb()

The EXT_ASSERT() in ext3_ext_new_extent_cb() is invalid since
new locking is introduced in ext4_ext_walk_space().

Signed-off-by: Yu Jian <yujian@whamcloud.com>
Change-Id: I8de3ad4004c304a45be14347df50bf066d8f4caa
Reviewed-on: http://review.whamcloud.com/2827
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1249 debug: Auto correct improper debug buffer size setting

Use the minimum required value when the debug buffer size setting
value is too small, and use the maximum acceptable value when it is
too large.

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I89def7762f2ec9da3a25d28f7ffa9aede390eb85
Reviewed-on: http://review.whamcloud.com/2489
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1088 ldlm: dump certain amount of locks for ldlm resouce

* dump last 256 granted locks for ldlm resource to avoid DDOS.
* replace ldlm_lock_dump with ldlm_lock_debug, and print nid.

Signed-off-by: Lai Siyao <laisiyao@whamcloud.com>
Change-Id: I9b369978496397be44578e8aa07e2bc8c8bde4af
Reviewed-on: http://review.whamcloud.com/2250
Tested-by: Hudson
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1378 fid: Add console info for super seq allocation

Add console information for super sequence allocation. Because
one super sequence will include 1 billion sequences, it rarely
happens in reality, so it will not cause the flood of console
msg.

Signed-off-by: Di Wang <di.wang@whamcloud.com>
Change-Id: I5154ee2a03006680b6a08d588287bf3941149457
Reviewed-on: http://review.whamcloud.com/2701
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-482 tests: cleanup clients/OSTs after MDS error

If the MDS fails to mount due to LU-482, ensure that the clients
and OSTs are unmounted cleanly.  Otherwise, the normal unmount
will hang on the clients as they wait for the MDS to be recovered.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Iccd8f81f714974063eaeec45ffbd80f9cef3242b
Reviewed-on: http://review.whamcloud.com/3019
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1031: add grouplock test to sanity.sh

add a simple grouplock test to sanity.sh (test_82)
replace hardcoded use of multiop by a $MULTIOP in
test scripts.

Change-Id: I94ba2248b7efafe258873c468e6d0cabdfcb7d09
Signed-off-by: jcl <jacques-charles.lafoucriere@cea.fr>
Reviewed-on: http://review.whamcloud.com/2098
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1442 llite: cleanup if a page failed to add into cache

In lustre, we assume that a dirty page must be queued in osc cache
for writing. However, in vvp_io_commit_write(), if a page failed to
add into cache, page dirty flag isn't cleared this will cause the
page will never be added into cache again.

Signed-off-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Change-Id: I1c132c6f1d4f5845682e51850eb895b292fc5f0d
Reviewed-on: http://review.whamcloud.com/3447
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
LU-1703 llite: Set page dirty before calling sync io

This problem is imported by commit 9053bd5f where master patch was
used for b2_1 directly. Unfortunately the page must be dirty to call
vvp_page_sync_io() to write a page.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: Ia804040d7a53973f72e13f769a94d52c847fa7f7
Reviewed-on: http://review.whamcloud.com/3521
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>