LU-5370 mdt: return -MDT_EREMOTE_OPEN for remote open

Add a special magical errno MDT_EREMOTE_OPEN for communicaiton between
mdt_reint_open() and mdt_intent_reint() which means return the lock to
the client for subsequent cross ref open. Previously we used plain
-EREMOTE but other functions called in that path might return it too
and confuse us. This is not returned to the client.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I7a498adc341c2b52b29c94f65e66431c5de06917
Reviewed-on: http://review.whamcloud.com/11218
Tested-by: Jenkins
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5463 osc: update kms in brw_interpret() properly

In brw_interpret(), we forgot page offset when calculating
write offset, that leads to wrong kms for sync write.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I9be90fefa384f9738c11737580637bcec96e5126
Reviewed-on: http://review.whamcloud.com/11374
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Li Dongyang <dongyang.li@anu.edu.au>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5442 lustre: always include libcfs.h in lustre_idl.h

Unconditionally include libcfs.h in lustre_idl.h. Since the landing of
LU-5327 libcfs: add libcfs/types.h it is possible to get definitions
for LPU64 without including libcfs.h. (Technically it was always
possible, but now it's much easier.)  The outer include guard was
added in LU-113: make lustre_{idl,user}.h nice to userspace. Since we
no longer package lustre_idl.h we remove this guard.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I55a453669fcd821f974d6f69ebc741595984d98d
Reviewed-on: http://review.whamcloud.com/11308
Tested-by: Jenkins
Reviewed-by: James Simmons <uja.ornl@gmail.com>
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: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3373 osd-ldiskfs: Use ext4_map_blocks for IO map

Use ext4_map_blocks instead patch ext4 code too much.

Signed-off-by: yang sheng <yang.sheng@intel.com>
Change-Id: Ifc0cf2e45fbcbff688c57d4da52e17471bd55386
Reviewed-on: http://review.whamcloud.com/8116
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5308 ofd: handle errors in ofd_fs_setup() path

In ofd_seqs_init() add calls to ofd_fid_fini() and ofd_fld_fini() in
the error path. In ofd_fs_setup() call ofd_seqs_fini() on error and do
not pass a NULL object to lu_object_put().

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Id7738ff69328411257abcb641da59180c2f9c8c6
Reviewed-on: http://review.whamcloud.com/11027
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5367 mdt: handle failed PDO lock in mdt_object_local_lock()

In mdt_object_local_lock() call mdt_object_unlock() if mdt_fid_lock()
fails on the PDO lock. This is needed because ldlm_cli_enqueue_local()
may initialize the passed in lock handle and then fail later.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I17a01d569a77a86f8ce72a1617f0cb8ed500985b
Reviewed-on: http://review.whamcloud.com/11219
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5414 mdt: avoid shrinking reply buffers on error

In mdt_getattr() if the LOV xattr size cannot be determined then
return err_serious(rc) and avoid shrinking the nonexistent reply
buffers.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I234ed3044c426e34cf35575eb26f7f961b03c0bd
Reviewed-on: http://review.whamcloud.com/11247
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5417 tgt: incorrect return code from tgt_handle_lfsck_query

Incorrect comparison of unsigned int with zero always false.
Therefore tgt_handle_lfsck_query() always return success.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: Idcb321880fb5071c93bebbba0a55961cdbe286dd
Reviewed-on: http://review.whamcloud.com/11290
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5417 lod: fix comparison between signed and unsigned

Make few members/variables related to size or indexes as unsigned.
Fix incorrect comparison between signed and unsigned variables.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I1bb3dff189e5ad4f37c7696ffd51832af60bd8f1
Reviewed-on: http://review.whamcloud.com/11316
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@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-5431 lmv: release locks if lmv_intent_lock() fails

In lmv_intent_lock() if we will return an error then first release any
locks referenced by the intent.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I43fa0d3869cf365175750b0cf944145c13f31006
Reviewed-on: http://review.whamcloud.com/11319
Tested-by: Jenkins
Reviewed-by: wangdi <di.wang@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>