LU-3498 kernel: remove uses of IS_ERR_VALUE()

Remove most uses of IS_ERR_VALUE(). This macro was often given an int
argument coming from PTR_ERR(). This invokes implementation defined
behavior since the long value gotten by applying PTR_ERR() to a kernel
pointer will usually not be representable as an int. Moreover it may
be just plain wrong to do this since the expressions IS_ERR(p) and
IS_ERR_VALUE((int) PTR_ERR(p)) are not equivalent for a general
pointer p.

Lustre-commit: 5cd7c3f2ab53a07cf98aef83685dafddb13077ed
Lustre-change: http://review.whamcloud.com/6759

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: Ib76592a1fc491539d28a51668c7f06347e988f9f
Reviewed-on: http://review.whamcloud.com/10363
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-4063 tests: use $DIR to check file at agent host

12a used to use DIR2 which is not mounted at agent host.

Lustre-change: http://review.whamcloud.com/#/c/7869/
Lustre-commit: f0f0a4951493859d213ae41b7818722e7c37e58a

Change-Id: Icad9a478700f4365d80233515931f9be28a78332
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-on: http://review.whamcloud.com/9860
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4266 build: fix lbuild to work with OFED-3.5-x

* Remove OFED backport headers for all components except lnet.
* Move all OFED related autoconf testing into lnet/autoconf.
* After OFED built is done, there should only be one -devel rpm.
  We don't really need to filter out any version string.

Lustre-commit: a48df9fbf812cd0fc00f5201a437f38b138c6df2
Lustre-change: http://review.whamcloud.com/8451

Change-Id: Ia5745b7dcd700a35231cf75404807d823952106d
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Reviewed-on: http://review.whamcloud.com/9109
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Shuichi Ihara <sihara@ddn.com>
Reviewed-by: Chris Horn <hornc@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4300 ldlm: ELC picks locks in a safer policy

Change the policy of ELC to pick locks that have no dirty pages,
no page in writeback state, and no locked pages.

Lustre commit: bfae5a4e4a37e4057200bcc70dbff14e18a00797
Lustre change: http://review.whamcloud.com/9175

Change-Id: I05f82a16bf10662c8242adc23e8c2582f0a2d866
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Reviewed-on: http://review.whamcloud.com/9451
Tested-by: Jenkins
Reviewed-by: Ann Koehler <amk@cray.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4384 ofd: add OBD_INCOMPAT_FID to the OST

OFD may work with normal FIDs since Lustre 2.4, add this flag for
backward compatibility with future use of normal FIDs on OST

Signed-off-by: Mikhail Pershin <mike.pershin@intel.com>
Change-Id: I24d7398388a8146da1e953d97d6c5776b97caa86
Reviewed-on: http://review.whamcloud.com/9411
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-4405 mdc: use ibits_known mask for lock match

Before revalidating a lock on the client, mask the lock bits against
the lock bits supported by the server (ibits_known), so newer clients
will find valid locks given by older server versions.

Xyratex-bug-id: MRP-1583

Lustre-commit: 6b557f04e55b14e11b7fce310094e71331c8b204
Lustre-change: http://review.whamcloud.com/8636

Signed-off-by: Patrick Farrell <paf@cray.com>
Signed-off-by: Alexey Lyashkov <alexey_lyashkov@xyratex.com>
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: I7088217fe28e45f1be6c8d1145b42de0f6228372
Reviewed-on: http://review.whamcloud.com/8847
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-4413 osp: move seq allocation out of osp_import_event

Because seq allocation(osp_init_pre_fid) might be stuck
during RPC, move it out of osp_import_event, which is
inside ptlrpcd_rcv. Otherwise, some other import RPCs(like
connect req)might be blocked in ptlrpcd_rcv.

Lustre-commit: 9b643f4f54c3e9e0c07c2211904a72ad9c4f823f
Lustre-change: http://review.whamcloud.com/8997

Signed-off-by: wang di <di.wang@intel.com>
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Change-Id: Ia41487d7859ec2cf8f0033dd97c7df98a18dcded
Reviewed-on: http://review.whamcloud.com/9875
Tested-by: Jenkins
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
LU-4509 ptlrpc: re-enqueue ptlrpcd worker

osc_extent_wait can be stuck in scenario like this:

1) thread-1 held an active extent
2) thread-2 called flush cache, and marked this extent as "urgent"
   and "sync_wait"
3) thread-3 wants to write to the same extent, osc_extent_find will
   get "conflict" because this extent is "sync_wait", so it starts
   to wait...
4) cl_writeback_work has been scheduled by thread-4 to write some
   other extents, it has sent RPCs but not returned yet.
5) thread-1 finished his work, and called osc_extent_release()->
   osc_io_unplug_async()->ptlrpcd_queue_work(), but found
   cl_writeback_work is still running, so it's ignored (-EBUSY)
6) thread-3 is stuck because nobody will wake him up.

This patch allows ptlrpcd_work to be rescheduled, so it will not
miss request anymore

Lustre-commit: d1dcff3084e929f5768dc733cdc104cddf168c06
Lustre-change: http://review.whamcloud.com/8922

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I4929d52b2d409c2ce081147bb5ee3dd380a86c43
Reviewed-on: http://review.whamcloud.com/8922
Tested-by: Jenkins
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-on: http://review.whamcloud.com/9705
LU-4569 hsm: Specify import source by FID.

Make the posix CT also accept a FID as import source parameter (from
which the path can be rebuilt) to allow easy "undeletion" of archived
files:

lhsmtool_posix --import <fid> /mnt/lustre/undelete ...

This patch also fixes a typo and replaces a bulky path construction by
a single asprintf() statement.

Lustre-change: http://review.whamcloud.com/9075
Lustre-commit a847e69c3b3853f547f99fcbb9c77259c4f3aa05

Change-Id: Id77841fe7c118872dba9654e88980585485e0ee4
Signed-off-by: Henri Doreau <henri.doreau@cea.fr>
Reviewed-on: http://review.whamcloud.com/10132
Tested-by: Jenkins
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4653 fid: only compare non-IDIF seq in lu_fid_diff

Because it will pack OST index into IDIF FID in 2.6, and
in 2.4/2.5, the OST index in IDIF FID is always 0. So we
only compare non-IDIF sequence in lu_fid_diff.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: Ia40f3e0196fdc8cd71050ca070e2bc310af18b55
Reviewed-on: http://review.whamcloud.com/10058
Tested-by: Jenkins
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4707 build: Don’t deploy the "lustre" init script on clients

Don’t deploy init scripts if they are not supported,
for example on none RedHat systems.

Don’t deploy the "lustre" and "ha.d" init scripts on clients.

Fix typo in lustre/scripts/lnet script.

Lustre-commit: 109e2da1b156cf038615513b838e18c8d6edf56f
Lustre-change: http://review.whamcloud.com/9535

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I8ce4ce7aba8e8040ab1dc6b58efb43dcc9bf51ba
Reviewed-on: http://review.whamcloud.com/9940
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4748 test: get one single qos_threshold_rr number

In sanity.sh test_116b, if there are multiple MDTs on the same MDS,
we should get one single qos_threshold_rr number instead of the array,
otherwise it will cause resetting qos_threshold_rr failure.

This is a backport of
Lustre-commit: b4a5e9545bcc9c4558fc8a564a8daa2ede997aa6
Lustre-change: http://review.whamcloud.com/9580/

Signed-off-by: Emoly Liu <emoly.liu@intel.com>
Change-Id: I6d7c143713dac809b2f308f7b4f0882345599638
Reviewed-on: http://review.whamcloud.com/9636
Tested-by: Jenkins
Reviewed-by: Jian Yu <jian.yu@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4858 ofd: ofd_osd is always valid

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

Lustre-commit: I3cb6d82b71b3018b4fc9e885eb6533b064179238
Lustre-change: http://review.whamcloud.com/10082

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Change-Id: I2ef4ba4a8faeaf8b718c9888332fa180c144d68b
Reviewed-on: http://review.whamcloud.com/10084
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>