LU-3636 llapi: llapi_hsm_copy_end() on correct FID on restore.

When doing a llapi_hsm_copy_end(), the FID sent to kernel should
be the DATA FID, when restoring. To be sure of that, the FID in
hsm_progress is used.

Signed-off-by: Aurelien Degremont <aurelien.degremont@cea.fr>
Change-Id: Ic378b76716057044f33a670089d738c950e07702
Reviewed-on: http://review.whamcloud.com/7112
Tested-by: Hudson
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3585 ptlrpc: Fix a crash when dereferencing NULL pointer

When a system runs out of memory and the function
ptlrpc_register_bulk() is called from ptl_send_rpc() the call to
LNetMEAttach() fails due to failure to allocate memory.  This forces
the code into an error path, which most probably previously went
untested.  The error path:
if (rc != 0) {
	CERROR("%s: LNetMEAttach failed x"LPU64"/%d: rc = %dn",
		desc->bd_export->exp_obd->obd_name, xid,
		posted_md, rc);
	break;
}
This print assumes that desc->bd_export is not NULL.  However, it is.
In fact it is expected to be NULL.  desc->bd_import is the correct
structure to access in this case.

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Change-Id: I772ec757af224b9868956cc3fc9dc00e804fe84d
Reviewed-on: http://review.whamcloud.com/7121
Tested-by: Hudson
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3643 ofd: get data version only if file exists

In ofd_getattr(), dt_version_get() could be called on a non-existant
object, leading to a NULL pointer for its inode.
It should try to call dt_version_get() only if attr_get returns
success; otherwise it will crash.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: Aurelien Degremont <aurelien.degremont@cea.fr>
Change-Id: I450fb78b85ea86d813ccad4de2f14f5bd4fca645
Reviewed-on: http://review.whamcloud.com/7124
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-1333 hsm: Add hsm_release feature.

HSM Release is one of the key feature of HSM. To perform HSM
release, clients need to acquire the file lease exclusivelt and
flush dirty cache from clients. A special close REQ will be sent
to the MDT to release the lease and get rid of OST objects.

Signed-off-by: Aurelien Degremont <aurelien.degremont@cea.fr>
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: I77eeccf81a852955354a382d80b887df00d1c4fc
Reviewed-on: http://review.whamcloud.com/7028
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-3635 hsm: Fix ASSERT(inode->i_nlink > 0)

Two different handlers were setup to access Agent LLOG.
One for coordinator access, and one for /proc accesses.
Both tried to clean the LLOG content when closing it, leading to
crashes.
Both now used handler initialized by MDS.

Signed-off-by: Aurelien Degremont <aurelien.degremont@cea.fr>
Change-Id: Ia6f22e9173266faf56a25e77fa5c9ae1bf69dc71
Reviewed-on: http://review.whamcloud.com/7111
Tested-by: Hudson
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2869 llite: extended attribute cache

This patch implements an extended attribute cache for
a Lustre client. It is organized as a write-through
cache: reads are performed from cache, updates are sent
synchronously to the MDS. An additional inode bit
MDS_INODELOCK_XATTR is added to protect the cache.

Signed-off-by: Andrew Perepechko <andrew_perepechko@xyratex.com>
Xyratex-bug-id: MRP-57
Change-Id: I16aae894a3c2f62448722eeade822ee22b20efa0
Reviewed-on: http://review.whamcloud.com/5537
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3649 lfsck: NOT cache lfsck local objects

When LFSCK build its local objects, such as "lfsck_bookmark", the
stack maybe not fully setup, and the local_storage uses own stack
and we should drop those objects from cache immediately after put.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I4b122f5a8518499d5986e1abfae912c6fb3cff5f
Reviewed-on: http://review.whamcloud.com/7153
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Tested-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3652 luref: Fix building

Fix build when building with --enable-lu_ref
enum cfs_alloc_flags is no longer present when building for Linux.

Change-Id: I0f705939de5ee55bfc9b9d99a23d93accf5831db
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-on: http://review.whamcloud.com/7150
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>