LU-2800 autoconf: remove LC_SECURITY_PLUG test

Only the SLES 10 kernel took a vfsmount for various vfs operations
to support AppArmor before the path variants were available.
We can remove the test and the dead code.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I5d4b1c1c9c4994582c51c39ef3b7375b2e0997d3
Reviewed-on: http://review.whamcloud.com/5360
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Tested-by: Hudson
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3549 llapi: add printf attribute to llapi_{printf,error}

Add printf attributes to llapi_printf and llapi_error for compile time
checking that the format string agrees with the argument list, and
const qualify the format parameter of both functions. Fixup the
mismatched calls to these functions.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: JC Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Change-Id: Ic8df148abb0bfe8ce72d05d76cb7ce0f1832c28f
Reviewed-on: http://review.whamcloud.com/6867
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-3416 llite: reset writeback index in ll_writepages

XXX: only the 2nd part of the patch is ported:

Also, a safety guard is added to limit the wait time for grant to
10 minutes(take recovery into consideration) at maximum in the
osc_enter_cache() function. Otherwise, EDQUOT will be returned to
the applications to start sync write.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-on: http://review.whamcloud.com/6554
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Change-Id: I2b20296e80a6d2a4034be8cf17129bc17780b847
LU-3581 osc: Lustre returns EINTR from writes when SA_RESTART is set

When Lustre is in a read or write system call and receives a
SIGALRM, it will return EINTR if interrupted in osc_enter_cache.
This prevents the system call from being restarted if
SA_RESTART is set in the handler.

This patch changes behavior in this location to return ERESTARTSYS
when a signal arrives during the call to l_wait_event.

Signed-off-by: Patrick Farrell <paf@cray.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I95423c5d572974352173f3c5c94d980385bfef29
Reviewed-on: http://review.whamcloud.com/7002
Reviewed-by: Rahul Deshmukh <rahul_deshmukh@xyratex.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Cory Spitz <spitzcor@cray.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-2800 autoconf: remove LC_FS_RENAME_DOES_D_MOVE test

FS_RENAME_DOES_D_MOVE has been upstream since v2.6.19.
We can remove the test and the dead code.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Change-Id: I71fc1e7c2216861dff2ce31f45c8ecaea64e7cfa
Reviewed-on: http://review.whamcloud.com/5348
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Tested-by: Hudson
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2800 autoconf: update LC_INODE_PERMISION_2ARGS test

inode_operations->permission has changed over time:
v2.6.27..v2.6.37 had a 2 arg version
v2.6.28..v3.0 had a 3 arg version
v3.1.. has a 2 arg version again

We move the test so it makes more sense in the list.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I0e9b2a35e934f8efb3bd932303cdee859d7a6b44
Reviewed-on: http://review.whamcloud.com/5363
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Hudson
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2800 autoconf: remove LC_RW_TREE_LOCK test

address_space.tree_lock has been a spinlock since v2.6.26.
We can remove the test and the dead code.

Change-Id: Ia9204ab7dfe76d053483244347f9a7194ac4e416
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Reviewed-on: http://review.whamcloud.com/5340
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3500 mdt: use __u64 for sp_cr_flags

In mdt_reconstruct_open() and mdt_open_by_fid(), when storing a copy
of the sp_cr_flags member of struct md_op_spec on the stack use __u64
rather than __u32. In mdd_create_data() use LPO64 for printing
sp_cr_flags.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Icaaafe537e9f9dea3934d6c85332d0a355299e25
Reviewed-on: http://review.whamcloud.com/6868
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2744 build: fix 'data race condition' issues

Fix 'data race condition' defects found by Coverity version
6.5.0:
Data race condition (MISSING_LOCK)
Accessing variable without holding lock. Elsewhere,
this variable is accessed with lock held.

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: I9c5eac037030f9f2fc49a26aaf2e1a125a2a0993
Reviewed-on: http://review.whamcloud.com/6569
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Hudson
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2744 build: fix 'data race condition' issues

Fix 'data race condition' defects found by Coverity version
6.5.0:
Data race condition (MISSING_LOCK)
Accessing variable without holding lock. Elsewhere,
this variable is accessed with lock held.

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: Ie23e735c630b45006e02f6dd04e682dabffb844f
Reviewed-on: http://review.whamcloud.com/6571
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2744 build: fix 'data race condition' issues

Fix 'data race condition' defects found by Coverity version
6.5.0:
Data race condition (MISSING_LOCK)
Accessing variable without holding lock. Elsewhere,
this variable is accessed with lock held.

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: Ia9bad7782b6289e84c11e7998957c732508e10a5
Reviewed-on: http://review.whamcloud.com/6567
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2744 build: fix 'data race condition' issues

Fix 'data race condition' defects found by Coverity version
6.5.0:
Data race condition (MISSING_LOCK)
Accessing variable without holding lock. Elsewhere,
this variable is accessed with lock held.

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: I706e4facef8d29a3b072f977c7a903e6c1772b71
Reviewed-on: http://review.whamcloud.com/6568
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-3521 clio: incorrect assertions in 'enable-invariants'

Fixed several incorrect assumptions in 'enable-invariants'.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I0b54a26afe4e750ef887d0ca9786699bf0ca6ba2
Reviewed-on: http://review.whamcloud.com/6832
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-1126 ldlm: Fix a race during FLock handling

Protect against race where lock could have been just destroyed
due to overlap, in ldlm_process_flock_lock().
Easy reproducer is BULL's NFS Locktests in pthread mode.
(http://nfsv4.bullopensource.org/tools/tests/locktest.php)

Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: I4f4183098e8e7aaacb2c6b80787d3c7a7ad5688b
Reviewed-on: http://review.whamcloud.com/7134
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
LU-2217 build: fix 'NULL pointer dereference' errors

Fix 'NULL pointer dereference' defects found by Coverity version
6.5.3:
Dereference after null check (FORWARD_NULL)
For instance, Passing null pointer to a function which dereferences
it.
Dereference before null check (REVERSE_INULL)
Null-checking variable suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.
Dereference null return value (NULL_RETURNS)

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: I646d75d488b66ed348ec51cc2b69f0b644474c30
Reviewed-on: http://review.whamcloud.com/4720
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3624 utils: fix lctl test_mkdir for use in mds-survey

The mds-survey script uses the 'lctl test_mkdir' command to create
directories for metadata tests. This currently raises the following
error message:
"...stre-2.4.0/lustre/include/lustre/lustre_idl.h:683:ostid_set_id())
Bad 18446744073709551615 to set 0:0"

This patch fixes the jt_obd_md_common() routine to avoid this error
to be generated.

Signed-off-by: Gregoire Pichon <gregoire.pichon@bull.net>
Change-Id: Idccc13166d6160bfb5f9ac6a79911cc27bfe77a2
Reviewed-on: http://review.whamcloud.com/7101
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobbie Lind <bobbie.j.lind@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-1199 build: Remove obsolete ext3 check

Remove the check for journal_callback_set() which was only needed
for ext3.

Also correct a couple of comments that still mentioned "ext3".

Change-Id: I0b4362eb1171051589f3772ddc253fa249019e6b
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/4678
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Brian J. Murrell <brian.murrell@intel.com>
LU-1199 build: Remove obsolete check for 2.4 kernels

Remove check for 2.4 kernels, which are no longer supported.

Change-Id: I4ed5b7c2686fa9b0c104444853e45900f90e1eb8
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/4679
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Brian J. Murrell <brian.murrell@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-1199 build: Remove check for obsolete compilers

The bad compilers that we were checking for are no longer in
use.

Change-Id: I754c8d23ef6547448ecc4b502ce6cf058d98f11c
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/4680
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Brian J. Murrell <brian.murrell@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-1199 ldiskfs: Remove HAVE_{EXT4,JBD2}_JOURNAL_CALLBACK_{SET,ADD}

Lustre servers now only support kernels/ldiskfs with
{ext4,ldiskfs}_journal_callback_add().  Additionally, the
HAVE_EXT4_JOURNAL_CALLBACK_ADD define is not in the upstream
3.3 kernel where the ext4_journal_callback_add() patch landed.

Therefore we remove the HAVE_{LDISKFS,EXT4}_JOURNAL_CALLBACK_{SET,ADD}
checks and just assume that it is set.

Change-Id: I10cc79fcf07dd05a10ae83014f188c613ab1620c
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/5055
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>