LU-1282 lprocfs: fix multi-thread contention glitch

* Revert clear stats patch committed on 8c831cb8, it is not multi-
  thread safe.
* Should protect the change of lprocfs_stats::ls_biggest_alloc_num
* Add a LPROCFS_STATS_FLAG_IRQ_SAFE flag, when a stat is non-percpu
  stats with this flag, lprocfs_stats_lock() should disable irq.

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I42f29e97ff75bf3817249940c8bb491af123d1d9
Reviewed-on: http://review.whamcloud.com/3240
Reviewed-by: Liang Zhen <liang@whamcloud.com>
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-888 lctl: remove perilous lctl {get,set,list}_param behavior.

This patch stops the {get,set)_param from potentially reading and
writing to file in the current working directory. Now lctl
{get,set,list}_param visits /proc/{fs,sys}/{lnet,lustre} for
parameter values. Specifying a file path to {get,set,list}_param
is deprecated behavoir.

Using a path with lctl {get,set,list}_param fails if the path does
not begin with '/proc/'. If the path begins with '/proc/' a warning
is printed the command executes using the given path.

A new helper function lprocfs_param_pattern is introduced to
provide checking and constructing the proc path.

Test suite has been searched for {get,set,list}_param lctl calls.
All specified parameters have been checked to ensure they are
not using the deprecated path interface.

lctl man page is updated to remove ambiguity around using paths
to specifiy parameters.

Signed-off-by: Richard Henwood <rhenwood@whamcloud.com>
Change-Id: I39e355b28fb1337f5b3a53f9e7265f4e969ddd2d
Reviewed-on: http://review.whamcloud.com/1765
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: John Hammond <jhammond@tacc.utexas.edu>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1415 utils: Process all {get,set}_param arguments

Process all arguments to get_param and set_param before returning an
error, to allow accessing one of multiple parameters that have changed
during code reorganization.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Li Wei <liwei@whamcloud.com>
Change-Id: Icb3019c8bd6ed83ffbfeae1fa54084f34df00c1e
Reviewed-on: http://review.whamcloud.com/3245
Tested-by: Hudson
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-1544 llog: remove lfs catinfo command

This patch removes the llog catinfo code, both client and server
side, since it has not been maintained and may crash the client
system in some cases.

Signed-off-by: Gregoire Pichon <gregoire.pichon@bull.net>
Change-Id: Ifa627e61d73a2a416bb548fcc510fb9ca3f36e79
Reviewed-on: http://review.whamcloud.com/3151
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bob Glossman <bogl@whamcloud.com>
Reviewed-by: Liu Xuezhao <xuezhao.liu@emc.com>
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-549 llite: Improve statfs performance if selinux is disabled

Don't disable all security xattrs when selinux is disabled just
disable security.selinux. Disabling all security xattrs was
overreaching and causing issues at a customer site.

This patch is built ontop of the original patch:
commit 7cc542fd4c26ccb117ceb13a47ac8ced3107b9b3.

Signed-off-by: Keith Mannthey <keith@whamcloud.com>
Change-Id: I73482d2ff1f166a48dceb3737df0e9e1b187dc85
Reviewed-on: http://review.whamcloud.com/2955
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1342 test: sanity-quota test_29

sanity-quota test_29() needs sleep enough seconds to take into account
both service time and network latency.

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: Ide2b321fbd104eede17eee109998d40d98fb2d30
Reviewed-on: http://review.whamcloud.com/2601
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Jay J Lan <jay.j.lan@nasa.gov>
LU-879 tests: Add test for checking rename_stats

Add 133d in sanity for checking rename_stats.

Signed-off-by: Di Wang <di.wang@whamcloud.com>
Change-Id: If9a57b9ac458fdf729c19f597d6197f410966e91
Reviewed-on: http://review.whamcloud.com/1970
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yu Jian <yujian@whamcloud.com>
LU-1209 tests: add debug info to 133d

Add more information in 133d to help understanding the
failure.

Signed-off-by: Wang Di <di.wang@whamcloud.com>
Change-Id: Ic84120fa5adcab9490abce732993c7c90d3e2881
Reviewed-on: http://review.whamcloud.com/2309
Reviewed-by: Andreas Dilger <adilger@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-1209 tests: get dir size after rename in sanity 133d

Because rename will change the directory size, so we
should get dir size after rename.

Signed-off-by: wang di <di.wang@whamcloud.com>
Change-Id: I1fee9f75cbc0163d10e9de7f04fcf00a4d5c1d9d
Reviewed-on: http://review.whamcloud.com/3298
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-1339 libcfs: add crc32 pclmulqdq implementation

Using hardware provided PCLMULQDQ instruction to accelerate the CRC32
disposal. This instruction present from Intel Westmere and
AMD Bulldozer CPUs.

Signed-off-by: Alexander Boyko <alexander_boyko@xyratex.com>
Reviewed-by: Alexander Zarochentsev <alexander_zarochentsev@xyratex.com>
Reviewed-by: Alexey Lyashkov <alexey_lyashkov@xyartex.com>
Xyratex-bug-id: MRP-314
Change-Id: Id6c88629f77cc5d389db49b7ee6e7111294c4a14
Reviewed-on: http://review.whamcloud.com/2586
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-1339 crc: remove #warning

Patch removes #warning from 32bit code path.

Signed-off-by: Alexander Boyko <alexander_boyko@xyratex.com>
Change-Id: I9183caf6bc1a98da0c78086ecd300e7cf6880eb0
Reviewed-on: http://review.whamcloud.com/3354
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-1481 build: quiet warnings due to := assignment

When running automake to generate Makefiles, newer compilers will
warn about non-portable assignments:

  lvfs/autoMakefile.am:52: `:='-style assignments are not portable

The use of ":=" vs. "=" determines when conditional expressions
are evaluated, but have absolutely no use for constant assignments,
so there is no point in using them at all in that case.

Convert all ":=" to "=" for constant assignments, leaving the
decision to use ":=" for conditional assignments until later.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I76caedbc1368a0d2fe02137c46b46c36fc3a500c
Reviewed-on: http://review.whamcloud.com/3129
Tested-by: Hudson
Reviewed-by: Brian J. Murrell <brian@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1129 obdfilter: handle race condition of recreating objects

During OST recovery, a race can happen while handling replayed
OST_WRITE request during the MDS->OST orphan recovery period to
recreate missing objects, which can trigger ASSERTION(diff >= 0)
failure.

This patch handles the above issue by adding obd->obd_recovering
into the assertion to check whether the OST is in recovery or not.
If it's in recovery and diff < 0, then no assertion failure occurs,
the object has been recreated. If the OST is not in recovery and
diff < 0, then the assertion failure occurs.

Signed-off-by: Yu Jian <yujian@whamcloud.com>
Change-Id: If486bc8221cf4b9d53b6de53e8ec14a4f3174b45
Reviewed-on: http://review.whamcloud.com/3391
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-709 build: cleanup VFS_KERN_MOUNT/INVALIDATEPAGE_RETURN_INT

1. vfs_kern_mount is added since v2.6.18
2. invalidatepage returns void since v2.6.17

Signed-off-by: Peng Tao <tao.peng@emc.com>
Change-Id: I9926072d2d519c64ef927e02a13a6e9b0c72f2af
Reviewed-on: http://review.whamcloud.com/2320
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-709 build: cleanup LC_SEQ_LOCK/FILEMAP_FDATAWRITE_RANGE

1. struct seq_file has lock instead of semaphore since v2.6.17
   and seq_file lock is not used in Lustre
2. filemap_fdatawrite_range is exported since v2.6.27
   andRHEL v2.6.18 back ported it. So all kernels Lustre
   supports now have it.

Signed-off-by: Peng Tao <peng_tao@emc.com>
Change-Id: I5730852789a5c19350eebb65fd61baf2a6512626
Reviewed-on: http://review.whamcloud.com/2321
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-709 build: clean up LC_STRUCT_INTENT_FILE and LC_SUNRPC_CACHE

1. open_intent.file was added since v2.6.14
2. cache_head.ref was added since v2.6.16

Signed-off-by: Peng Tao <peng_tao@emc.com>
Change-Id: Ie4047431f56cf71ef7a17115c2cd1a3812256419
Reviewed-on: http://review.whamcloud.com/2314
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-709 build: clean up HAVE_CAN_SLEEP_ARG and HAVE_F_OP_FLOCK

1. flock_lock_file_wait only has two arguments ever since v2.6.12
2. file_operations.flock exists since v2.6.12

Signed-off-by: Peng Tao <peng_tao@emc.com>
Change-Id: I92406f1042dab71ade780b02500fba4404a56a2b
Reviewed-on: http://review.whamcloud.com/2315
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-709 build: cleanup lustre-lnet.m4 and ofed.m4

1. HAVE_SPINLOCK_T is not used
2. OFED supports iWarp transport since v2.6.18

Signed-off-by: Peng Tao <tao.peng@emc.com>
Change-Id: Ieb5971f359b5d81b7dce3db8ea732ca33c6cbd53
Reviewed-on: http://review.whamcloud.com/2327
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Liang Zhen <liang@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-709 build: clean up quota_read, follow_link and RCU

1. super_operations.quota_read exists since v2.6.12
2. inode_operations->follow_link returns a cookie since v2.6.13
3. RCU exists since v2.6.12

Signed-off-by: Peng Tao <tao.peng@emc.com>
Change-Id: Id79df5dcb0e3db9eb424337fd71d896ed8fefcd6
Reviewed-on: http://review.whamcloud.com/2316
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
LU-709 build: clean up percpu_counter and sb.s_time_gran

1. linux/percpu_counter.h exists since v2.6.12,
   percpu_counter_init() takes two arguments since v2.6.17,
   and percpu_counter is not used in lustre
2. superblock.s_time_gran exists since v2.6.12
3. get_sb_time_gran() doesn't exist since v2.6.12

Signed-off-by: Peng Tao <tao.peng@emc.com>
Change-Id: Id80b0bfc702f509218fcf29d01334894d122b9c8
Reviewed-on: http://review.whamcloud.com/2317
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>