LU-220 open: try open_by_fid for the known object

If the current path for thread1 on client1 is renamed by thread2
on client2, then when thread1 tries to open its current path, it
should use the fid, but not the name. Otherwise, the open on MDS
will hit unexpected "-ENOENT".

Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Change-Id: I905113167ebd6fe5f0185007d0e9c77083342680
Reviewed-on: http://review.whamcloud.com/2493
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-2275 mdt: Avoid setting positive dispositions too early

mdt_finish_open and mdt_open_by_fid_lock set DISP_LOOKUP_POS
and DISP_OPEN_OPEN a bit too eagerly only to have later code add
negative disposition and a lookup error, confusing a client
with such self-contradicting replies in the end.

This patch only sets positive dispositions when we are sure
not to get them overruled.

Change-Id: I3389f1d59b21f4a9e4c16ca75b398785ea6e130c
Signed-off-by: Oleg Drokin <green@whamcloud.com
Reviewed-on: http://review.whamcloud.com/4459
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1697 mdt: create OST-objects for open by fid

Original prcessing for open by fidi gnored the case of OST-objects
to be created because of re-exporting by NFS or O_LOV_DELAY_CREATE
flags, then MDD failed to find useful stripe EA to create releated
OST-objects.

Rename mdt_open_anon_by_fid() to mdt_open_by_fid_lock() to make it
more match the real use cases.

Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Change-Id: I3c0e4791f6f74fa6b365d41a8e550dba518b39cc
Reviewed-on: http://review.whamcloud.com/3537
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-2523 mdt: handle -ENOENT && !MDS_OPEN_CREAT in reint open

If mdt_open_by_fid_lock() returns -ENOENT and MDS_OPEN_CREAT is not
set in create flags then bail out and return -ENOENT from
mdt_reint_open().  In mdt_open_by_fid_lock() if -ENOENT is returned
then ensure that DISP_IT_EXECD is set in the reply disposition.  Add
sanity test_27B to call the LL_IOC_LOV_SETSTRIPE ioctl() on an open
unlinked file, a situation which triggers the first case.  In sanityn
test 30, remote the requirement that opening an unlinked file via
/proc/PID/exe return -ESTALE.  In racer's file_create.sh, reinstate
the call to 'lfs setstripe' before dd is started, effectively
reverting commit 0be1c87fe2d4ffddaca9e568cc137518b7368b2d.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I74e2297c4210ff18acbf60efdf51049d9a88cbea
Reviewed-on: http://review.whamcloud.com/5417
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Hudson
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>