LU-4557 ext4: recalc percpu counters after journal

the percpu counters is initialized before replaying the journal,
but after the journal it should be recalculate to deal with the
possibility of the percpu counters getting updated by the journal
replay.

the issue has been fixed in the new kernels (RHEL6 2.6.32-431.5.1,
SLES11SP3 3.0.101-0.15), then it is not needed for these kernels.

Change-Id: I5dfa0696b5ccd404b1add9ad6e2b0877d86a35b2
Signed-off-by: Hongchao Zhang <hongchao.zhang@intel.com>
Reviewed-on: http://review.whamcloud.com/9908
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
LU-3333 ptlrpc: Protect request buffer changing

*_enlarge_reqbuf class of functions can change request body location
for a request that's already in replay list, as such a parallel
traverser of the list (after_reply -> ptlrpc_free_committed) might
access freed and scrambled memory causing assertion.

Since all such users only can get to this request under imp_lock, take
imp_lock to protect against them in *_enlarge_reqbuf

Change-Id: I0fa690aabd8696a9f05b94c66e06e30eefb5c759
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-on: http://review.whamcloud.com/10074
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-4941 lfsck: check LOV EA header properly

1) If the LFSCK does not recognize the magic, then check whether
   the magic's postfix match the LOV_MAGIC_MAGIC or not: if yes,
   then it is quite possible that the system was downgraded from
   a new release with new LOV magic, so it is better to keep the
   current LOV EA unchanged; otherwise, it is crashed LOV EA and
   should be repaired by the LFSCK.

2) Check the pattern with lov_pattern().

3) Drop redundant LOV EA header verification.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: Iad3a1d6fc50a5dfba977a534fdb253bc9f6373e5
Reviewed-on: http://review.whamcloud.com/10045
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4920 quota: always clear lqe_lockh on lock cancel

In the qsd_id_blocking_ast(), lqe_lockh should always be cleared,
otherwise, quota code will mistakenly assume the id lock is still
valid.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: Iac73216d130aebe1b73226d260807f3a9cedc635
Reviewed-on: http://review.whamcloud.com/9965
Tested-by: Jenkins
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-4924 llite: Only kill SGID/SUID bits

Check that attr mode is valid before using it when determining if to
clear SGID and SUID bits in ll_setattr.
Add regression test.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: I2b221e80a5bb167f8670f376ce97d62d720ad857
Reviewed-on: http://review.whamcloud.com/10071
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Revert "LU-4924 llite: Only kill SGID/SUID bits"

Did not notice that this introduces 100% failure all in itself.

This reverts commit 70c37954649fbc4fc2d0820d5d422f96144071f9.

Change-Id: If27762e2ffa9afc3857446a733ee3a8751fe6292
Reviewed-on: http://review.whamcloud.com/10151
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Tested-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4895 lfsck: not create object to repair dangling by default

If the OST-object which is referenced by some MDT-object does not
exist, the layout LFSCK should not create the lost OST-object by
default; otherwise related application(s) may miss to be aware of
the bad file.

The LFSCK will allow the administrator to specify how to handle
the dangling reference case via a new option "-c" when trigger
the LFSCK:

[-coff] or [--create_ostobj=off]:
Report the inconsistency via log, but keep the dangling reference
there without repairing. (by default)

-c[on] or --create_ostobj[=on]:
Create the lost OST-object.

Change syntax for dryrun:
[-noff] or [--dryrun=off]:
Disable dryrun mode. (by default)

-n[on] or --dryrun[=on]:
Enable dryrun mode.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I8fa1e5bbea63c7368e04052c88311a9ea0c6f969
Reviewed-on: http://review.whamcloud.com/9989
Tested-by: Jenkins
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4556 tests: speed up sanity-lfsck and sanity-scrub tests

1) drop unnecessary devices reformat.
2) drop unnecessary system stop/re-start.
3) replace 'sleep' with wait_update_facet to avoid idle wait.
4) drop unnecessary "-p" option for some "mkdir" cases.
5) replace "touch" with "createmany -m".
6) other code style changes and cleanup.

Test-Parameters: envdefinitions=SLOW=yes testlist=lfsck-performance
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I047c63b8793fa843fabe1a69b332c42f2f523f68
Reviewed-on: http://review.whamcloud.com/9704
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-992 doc: remove old kernels from lustre/ChangeLog

Remove the old and obsolete kernels from the current list of
kernel versions that Lustre works with, since this is confusing
to list kernels that are no longer supported at all.

Update kernel patch documentation to make it clear which patches
should be applied.

Update recommended e2fsprogs version to include "or newer".

Move ldiskfs README file to top-level directory.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: Ia4859b3b2bf5a8aa9faabeb43d554130143ebbe5
Reviewed-on: http://review.whamcloud.com/8186
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Jenkins
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3227 tests: fix for acl test

acl permission test will failed by a wrong system
message. Change script to adapt this issue.
Combined with other small change for lprocfs.

Signed-off-by: Yang Sheng <yang.sheng@intel.com>
Change-Id: I42d1e02c0f0990500b02085d60e2dc47f93f1bcc
Reviewed-on: http://review.whamcloud.com/10007
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4717 llite: suppress non active IO error message

Current CLIO does not support fadvise, suppress the error message.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: Iab3133ecc08cf0890ab3aa55018565d3d9f96e07
Reviewed-on: http://review.whamcloud.com/9658
Tested-by: Jenkins
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4858 ofd: statfs small fixes

ofd_osd is valid in its life time because ofd is released before
osd, so it should never be cleared.

revive o_statfs for ofd_obd_ops which was mistakenly removed in
commit I5622e14bccacb809bca1c10499c23bcaf72e2a68.

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Change-Id: I3cb6d82b71b3018b4fc9e885eb6533b064179238
Reviewed-on: http://review.whamcloud.com/10082
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
LU-2177 ldlm: flock completion fixes.

move checks for FAILED, DESTROYED flags under ldlm spinlock,
destroy flock atomically with the check it is not destroyed yet.

do not put the granted flock into the resource if this is
UNLOCK, TEST, or DEADLOCK'ed flock.

a set of flock tests which races reply completion for
new flock request/test flock/unlock with namespace cleanup
on eviction.

Signed-off-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Change-Id: I97fa040a26eda6c6728929d10b29c2316db663e3
Reviewed-by: Alexey Lyashkov <alexey_lyashkov@xyratex.com>
Reviewed-by: Andriy Skulysh <andriy_skulysh@xyratex.com>
Tested-by: Alexander Lezhoev <alexander_lezhoev@xyratex.com>
Reviewed-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Xyratex-bug-id: MRP-1588
Reviewed-on: http://review.whamcloud.com/10005
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4008 mdt: update mdt_getattr comments about EA sizing

After landing previous patches, some comments became out of date
This patch tries to rectify the situation and also adds some
additional explanations.

Change-Id: Ic3fb33ec60f7ae083ecae84cd207d2c10b95f965
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-on: http://review.whamcloud.com/10141
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
LU-20 kernel: remove rest of obsolete kernel patches

Remove several patches that have not been used in some time.
The bio_add_page patch addressed an performance issue with
SLES11 SP1 1.8 servers with direct IO. All platforms have
support for 64 bit quota so we can remove the patch to enable
it on old SLES11 platforms. We no longer need the function
security_inode_unlink exported since the fsfilt layer has now
been removed.

Change-Id: I6a2d324950ba8e51f3d7785016d9834f6b26aafd
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Reviewed-on: http://review.whamcloud.com/9199
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
LU-4954 mdd: validate names before create, link, and rename

In lu_name_is_valid() check that the length of the ln_name is equal to
ln_namelen and check that there are no embedded slashes. Add
mdd_name_check() which calls lu_name_is_valid() and check against the
mdd ENAMETOOLONG limit. Call mdd_name_check() from
mdd_create_sanity_check(), mdd_link_sanity_check() and mdd_rename().

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I66413b796177f042fc9bd87e98338de9e5125cae
Reviewed-on: http://review.whamcloud.com/10111
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-4423 gss: Fix typo in sec_gss.c

This patch fixes spelling typos in comments within sec_gss.c

Came from upstream from Masanari Iida <standby24x7@gmail.com>
commit 08c4c90dc2cfb719b787b39fb9cab9880b60d779

Change-Id: Ibf3543745cc0932a3a560cc274edf95a7411198d
Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-on: http://review.whamcloud.com/10119
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
LU-4423 ptlrpc: Fix function prototypes

ptlrpc_request_cache_init and ptlrpc_request_cache_fini
added by request cache code did not include argument type
in the declaration which causes a checkpatch warning.

Change-Id: I41f4f96cfbc9e63417b6adbe6ba1902248494fbb
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-on: http://review.whamcloud.com/10120
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
LU-4961 lustre: move ioctls to lustre_ioctl.h

Move ioctl definitions and related functions from lustre_dlm.h,
lustre_lib.h, obd.h, to lustre_ioctl.h. Replace the definitions of
retired ioctls with comment. Remove inclusions of lustre_dlm.h,
lustre_lib.h, and obd.h in userspace, adding lustre_ioctl.h where
needed. Remove the uses of lov_stripe_md from jt_obd_create() in
lustre/utils/obd.c. Remove the unused commands obdio and obdbarrier.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I076ac84084ae3166e9b4525f2813510482523dc9
Reviewed-on: http://review.whamcloud.com/10139
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Robert Read <robert.read@intel.com>
LU-2675 obd: decruft md_enqueue() and md_intent_lock()

Remove the lmm and lmmsize parameters from both functions, storing
that data in md_op_data when needed. Remove the unused lookup_flags
parameter from md_intent_lock(), and the unused reqp parameter from
md_enqueue(). Add a union ldlm_policy_data * parameter to
md_enqueue(). Remove the unused function lmv_enqueue_remote().

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I5c216b24d8ac824b9487c3296f18b7a8511285e3
Reviewed-on: http://review.whamcloud.com/9850
Tested-by: Jenkins
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>