LU-4098 lmv: Match MDT where the FID locates first

With DNE every object can have two locks in different namespaces:
lookup lock in space of MDT storing direntry and update/open lock
in space of MDT storing inode. In lmv_find_cbdata/lmv_lock_lock,
it should try the MDT that the FID maps to first, since this can
be easily found, and only try others if that fails.

In the error handler of lmv_add_targets, it should check whether
ld_tgt_count is being increased before ld_tgt_count is being -1.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: Idf90ff97421102da97febb0aebaff3f702ff5df7
Reviewed-on: http://review.whamcloud.com/8019
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
LU-4929 llite: use the correct mode for striped directory

Create striped directory with correct mode, which should be
handling same as mkdir.

Add -m option to setdirstripe so the user can create stripedir
with specified mode.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I4d7d186d4c820cfbdddd0aac9012e7e5e2454278
Reviewed-on: http://review.whamcloud.com/10028
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
LU-4345 osp: store valid bits in setattr record

We'd store LA_UID/LA_GID bit along with the UID/GID in the setattr
llog record, otherwise, osp could set a random uid/gid to the OST
object.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I17de21071127325ade8dea6f8618b622fec1768d
Reviewed-on: http://review.whamcloud.com/10223
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
LU-4932 doc: desgin doc for LFSCK

LFSCK design documentation has previously been recorded in an wiki
external to the souce code. This commit adds a first draft of the
design highlights of the LFSCK feature. A new directory has been
created to house this and other future design documents modelled
after the Linux Kernel 'Documentation' directory.

This document includes an introduction, quick usage and features.
In addition there are sections that cover the two phase design of
LFSCK as well as a overview of the file system traversal methods
that design have been implemented. Finally, a further reading
section is included as well as a glossary of Lustre specific
terms.

Change-Id: I598261efd7fc4ac71a32a301b8afe8c60b592ace
Signed-off-by: Richard Henwood <richard.henwood@intel.com>
Reviewed-on: http://review.whamcloud.com/10033
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Ned Bass <bass6@llnl.gov>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5113 osd: add striped dir feature flag to LMA

Add striped directory feature flag(LMAI_STRIPED) to LMA, so
once MDS is downgraded, the striped directory will be accessed
by old lustre(< 2.6) on MDT.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I763217e3554dc4d68ee2f72d53c0e119fff6cbef
Reviewed-on: http://review.whamcloud.com/10463
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5090 build: restore enable-mpitest option

Originally the enable-mpitests configure option was deeply
embedded in the liblustre configuration test. With the
removal of liblibustre this option got accidentally removed.
This patch restores this option.

Change-Id: I92ab1d3f187f579dca4bb6825a5bf1e80dbbee06
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Reviewed-on: http://review.whamcloud.com/10384
Reviewed-by: Brian J. Murrell <brian.murrell@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5116 ptlrpc: race at req processing

Race between ptlrpc_resend_req() and ptlrpc_check_set().
1 thread do ptlrpc_check_set()->after_reply()
2 thread do ptlrpc_resend_req()
The result is request with rq_resend = 1 and MSG_REPLY flag.
When this request will came to server it will cause client eviction.
The patch skip ptlrpc_resend_req logic if rq_replied is set,
and clear rq_resend flag at reply_in_callback() when client got
reply.

Signed-off-by: Alexander Boyko <alexander_boyko@xyratex.com>
Xyratex-bug-id: MRP-1888
Change-Id: If47b9a1f559ab16e4b416332ada7c73a8758d46c
Reviewed-on: http://review.whamcloud.com/10471
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Chris Horn <hornc@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3222 ofd: use of ofd_XXX helpers

Replace explicit use of some obd fields by ofd helpers.

Signed-off-by: Emoly Liu <emoly.liu@intel.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I83bf64f0f41eac834b47c216d02f9cac8d505207
Reviewed-on: http://review.whamcloud.com/8780
Tested-by: Jenkins
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
LU-4416 mm: Backport shrinker changes from upstream

Convert shrinker to new count/scan API.
--ptlrpc shrinker
--lu_object shrinker
--ldlm pool shrinker

Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Yang Sheng <yang.sheng@intel.com>
Change-Id: Idbd7cd3b7488202e5e8f6fdf757ae6d20e28d642
Reviewed-on: http://review.whamcloud.com/9300
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2675 obd: remove dead code

Remove unused OBD functions: obdo_to_inode(), is_osp_on_mdt(),
oti_init(), oti_alloc_cookies(), oti_free_cookies(),
obdo_from_iattr(), obdo_from_md(), obd_create_async(), obd_pin(),
obd_unpin(), obd_llog_connect(), obd_pin_observer(),
obd_unpin_observer(), md_is_subdir(), md_readpage(), obdo2fid().

Remove several unused, get-only, and set-only structure members.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I4a9567798259cfde0cf0ab0ae691daac21e29b9c
Reviewed-on: http://review.whamcloud.com/9784
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-3953 build: fix paths for generated headers

Headers that are generated during kernel build and placed
in various include/generated directories are always in
the kernel build dir. There are several places in which the kernel
source dir is used instead. This causes configure/build failures
on systems using separate build and source directories.

This patch cleans those paths up.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Change-Id: I7335a8088d25f1e3bf64d8c131b542dfce38fff0
Reviewed-on: http://review.whamcloud.com/10160
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5047 tests: correct cleanup files in sanity.sh

Don't remove all files from Lustre share. Create files that will be
cleaned up at the end tests session in check_and_cleanup_lustre().

Fix cleanup for test_54c.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I23624b9d14e7de3423b82b4a5b8508c4820c55d4
Reviewed-on: http://review.whamcloud.com/10291
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5051 hsm: do not reallocate hsm receive buffer

Instead of allocating 1MB for every call to
llapi_hsm_copytool_recv, allocate that buffer once in
llapi_hsm_copytool_register. The application must not call
llapi_hsm_copytool_recv until it has cleared the data from
the previous call, which lhsmtool_posix already does. This
also make llapi_hsm_action_list_free unnecessary.

Signed-off-by: Patrick Farrell <paf@cray.com>
Signed-off-by: Frank Zago <fzago@cray.com>
Change-Id: Ie9e15a5cb4e3ba6d3fe23d40ee2bb47330280abf
Reviewed-on: http://review.whamcloud.com/10299
Tested-by: Jenkins
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5058 llite: support root squash on newer kernels

The fix for the root squash bug for LU-1778 does not
handle the new namespace changes in newer kernels.
This patch restores that functionality.

Change-Id: I2b3bd8a18b94108cc78f55e33f61fa788e353721
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Reviewed-on: http://review.whamcloud.com/10325
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Grégoire Pichon <gregoire.pichon@bull.net>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5041 osd-zfs: Prefetch dnodes

After a successful FID lookup prefetch the referenced dnode.  There's
every reason to believe the dnode will be immediately useful.  This
will not result in a spill block also being prefetched for that we
need the block pointer from the dnode.  However, once large dnodes
are supported spill blocks should be rarely needed.

Change-Id: I41c0d08249f5d852137a08e2f3b262fb664a15ea
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-on: http://review.whamcloud.com/10395
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>