LU-5150 mdc: Handle empty but non-zero acl xattr

We have found that posix_acl_access can have a value
of \002\000\000\000.  In that case body->aclsize is
non-zero, but the there are no actuall acls stored
in the xattr.

In mdc_unpack_acl(), it only checks IS_ERR() on the
pointer returned by posix_acl_from_xattr(), it does not
check for NULL.  Because of the above situation, the
xattr aclsize can be non-zero, but posic_acl_from_xattr()
still returns NULL.  Passing NULL to posix_acl_valid()
crashes the kernel.

We add a check to properly handle the NULL return value.

This patch is back-ported from the following one:
Lustre-commit: 867e301972278e397b57094810821ff884092fd8
Lustre-change: http://review.whamcloud.com/10620

Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Change-Id: I76fb2198e7233261ee65c6527d4f2b78f27022bc
Reviewed-on: http://review.whamcloud.com/11989
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5287 export: hold exp_lock when modify exp_flags

There are few places that changing the exp_flags without holding
exp_lock, that could overwrite other concurrent exp_flags updating.

Lustre-commit: 999fedbd5c18a021064b23933e84e4c92a7f48ac
Lustre-change: http://review.whamcloud.com/11871

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: I9c0421ffeacd6bf6feaa31dca9f9fc0e7963bc8b
Reviewed-on: http://review.whamcloud.com/12162
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5079 ptlrpc: fix early reply timeout for recovery

Commit 8b2f9c0e408 http://review.whamcloud.com/9100 changed
the deadline calculation from current time to request arrival.
During recovery, the new deadline could be less than calculated
at request arrival time. And even worse, the deadline may be
in past. For the first case unneeded early reply would be sent
to client. For the second, client requests would be dropped by
timeout and client reconnect happend.

Do at_measured() for recovery in the same way like general early
reply base on the current time. And set new timeout to the end
of recovery.

Test to check recovery deadline bug.

The patch also speeds up replay-vbr test 7* by decreasing the
at_max value in test_7_cycle().

This patch is back-ported from the following one:
Lustre-commit: 1d889090f2e2902d861d1fab0227c4343127cc42
Lustre-change: http://review.whamcloud.com/11213

Test-Parameters: alwaysuploadlogs \
envdefinitions=SLOW=yes,ENABLE_QUOTA=yes \
mdtfilesystemtype=ldiskfs mdsfilesystemtype=ldiskfs ostfilesystemtype=ldiskfs \
clientdistro=el6 ossdistro=el6 mdsdistro=el6 \
mdtcount=1 mdssizegb=2 ostcount=7 ostsizegb=2 \
testlist=replay-vbr,replay-vbr

Xyratex-bug-id: MRP-1988

Change-Id: I7a5d60ca8e52a805546cc9934eb42bddeaf8ff4e
Signed-off-by: Alexander Boyko <alexander_boyko@xyratex.com>
Signed-off-by: Jian Yu <jian.yu@intel.com>
Reviewed-on: http://review.whamcloud.com/12365
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2059 mgs: don't fail on missing params log

The mgc_process_cfg_log() fails if 'params' log is not
accessinble and has no local copy. In fact that log is
optional and may be just empty.

Patch allows 'params' log to be empty and checks also for
'params' log in other places to avoid wrong error messages.
There was also deprecated code in mgs_write_log_direct_all()
which creates lustre-params log which is not used by anyone now.
Third change is removal of exceptions in conf-sanity.sh and
insanity.sh related to LU-2059

The only exception is insanity test_1 which is still failed due
to other reason.

This patch is back-ported from the following one:
Lustre-commit: 864fc9daac267819f5e3bdebef6cdac4c6325626
Lustre-change: http://review.whamcloud.com/10311

Signed-off-by: Mikhail Pershin <mike.pershin@intel.com>
Change-Id: I081ca3920f3c2d05d4e966ed5234369ddc0eaac0
Reviewed-on: http://review.whamcloud.com/12427
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Hongchao Zhang <hongchao.zhang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2059 mgs: fix a bug in mgs_llog_open

- don't calculate len for NULL ptr
- check the logname is PARAMS_FILENAME inside 'if (ptr == NULL ...)
clause so all cases with NULL ptr will end there.

This patch is back-ported from the following one:
Lustre-commit: 8c21986e79f50131b0f381e5fe0311294328d660
Lustre-change: http://review.whamcloud.com/10589

Signed-off-by: Mikhail Pershin <mike.pershin@intel.com>
Change-Id: Ic69866e91acad7920085848faf12c69bf3d17f12
Reviewed-on: http://review.whamcloud.com/12428
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Hongchao Zhang <hongchao.zhang@intel.com>
LU-5795 kernel: kernel update [SLES11 SP3 3.0.101-0.40]

Update target and config files for new version

Test-Parameters: mdsdistro=sles11sp3 ossdistro=sles11sp3\
 clientdistro=sles11sp3 mdsfilesystemtype=ldiskfs\
 mdtfilesystemtype=ldiskfs ostfilesystemtype=ldiskfs

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: Iac6e9dc76a6d2bdeb5615bffaeaa5e69652f31ba
Reviewed-on: http://review.whamcloud.com/12402
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4298 utils: do not create file with no striping info

'lfs setstripe' should not create a file with no striping
information if bad values are given. The input parameter
check in llapi_file_open_pool is moved before the file open
to catch bad parameters before the file is created.

A check is added to sanity test 27f to make sure
'lfs setstripe -s' does not create a file with no
striping information.

Lustre-commit: 823147fa760752c8c2ff11a5bd74f71f819f9e4e
Lustre-change: http://review.whamcloud.com/8375

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Signed-off-by: James Nunez <james.a.nunez@intel.com>
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: I19beef973dc3a62bf2cb443e02195896772702fc
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-on: http://review.whamcloud.com/12335
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4749 mgs: Recognize colons in failover.node values

Current mgs assumes that all the NIDs in a single failover.node
parameter belong to one node.  This is not the case, even prior to
http://review.whamcloud.com/11161, because mkfs.lustre options like

  --servicenode=<nid1>,<nid2>:<nid3>,<nid4>

are allowed.

Lustre-commit: bbe5f8ec92c63cc4fcb9ab0b316e92fb2a3d9683
Lustre-change: http://review.whamcloud.com/11956

Change-Id: If3e2ebc0e81093e9c8304e496afdca24edf456ef
Signed-off-by: Li Wei <wei.g.li@intel.com>
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-on: http://review.whamcloud.com/12196
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
LU-4669 ldiskfs: do not export static inline functions

In ldiskfs/ldiskfs_extents.h, both ldiskfs_ext_store_pblock()
and ldiskfs_ext_pblock() are defined as static inline functions.
However, commit 49b06fba39e (http://review.whamcloud.com/4804)
exported these two functions in ldiskfs/extents.c, which is not
allowed by gcc and causes the following compile errors:

error: __ksymtab_ldiskfs_ext_pblock causes a section type conflict
error: __ksymtab_ldiskfs_ext_store_pblock causes a section type conflict

This patch fixes the above errors by not exporting the two functions.

This patch is back-ported from the following one:
Lustre-commit: e387b0e21c093ebbfb7571cd9e65a98d8e7e5718
Lustre-change: http://review.whamcloud.com/9401

Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: I9ba2aa39d9d9dc97e74bd29b8513b86eed7fe175
Reviewed-on: http://review.whamcloud.com/12431
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-4669 type: change "%llx" to "LPX64”

This patch fixes the following compile errors by using "LPX64”:
error: format '%llx' expects type 'long long unsigned int',
       but argument 5 has type '__u64'
error: format '%#llx' expects type 'long long unsigned int',
       but argument 3 has type '__u64'

This patch is back-ported from the following one:
Lustre-commit: f1eaf5e99aa9093b7a0fac7ae11e741560f64c31
Lustre-change: http://review.whamcloud.com/9811

Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: I0637f2c0a1e57cf8ab89d8fe9c905145724fded3
Reviewed-on: http://review.whamcloud.com/12432
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-4588 code: replace semaphores with mutexes

It's just optimization. The mutex subsystem is slightly faster
and has better scalability for contended workloads.

Remove the lustre_lock and it's accessor functions l_lock(),
l_unlock(), l_lock_init(), and l_has_lock() since they have
not been used by the code since Lustre 1.6.

Lustre-Commit: 34b9fe2f703d91e7ad5b315aaac696d3a314cf0b
Lustre-Review: http://review.whamcloud.com/9294

Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: Iea30c0853faf1ff18821b1facd2020ef91df1764
Reviewed-on: http://review.whamcloud.com/12258
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>