LU-5144 mdt: rename vs link deadlock

it may happen that tgt child for rename is a directory, which is used
as tgt dir for link in parallel, as the result rename locks src child,
tgt child what may deadlock with tgt dir, src file locking of link.

As not dir cannot replace dir, check it before locking the tgt child.

Signed-off-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Xyratex-bug-id: MRP-1921
Change-Id: If8b91d27e4d978853e4b8fbb025667d22c9d2f02
Reviewed-on: http://review.whamcloud.com/10570
Tested-by: Jenkins
Tested-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4725 obd: lu_object_find_at hung

lu_object_find_at hungs if called 2 times and object is removed
in between. It makes mdt_rename_sanity not workable for rename.
Change mdt_rename_sanity to work on existing object.

Signed-off-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Xyratex-bug-id: MRP-1700
Change-Id: I173e2fe3f87bc88fcc73c1813cfe4298fb515c50
Reviewed-on: http://review.whamcloud.com/10484
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5153 fld: lsf_lock in update_from_controller

The lsf_lock mutex must be held for calls to
fld_index_create, and is currently taken before calls to
fld_insert_entry.

This patch adds a comment and an assertion to
fld_insert_entry, and takes the mutex for the call in
fld_update_from_controller.

Also adds subsystem description from Di Wang to header file.

Signed-off-by: Patrick Farrell <paf@cray.com>
Change-Id: I3dcc9a53589d128343d9f386eaf7265f39ff5840
Reviewed-on: http://review.whamcloud.com/10631
Tested-by: Jenkins
Reviewed-by: wangdi <di.wang@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-4629 osd-ldiskfs: fix uninitialized members

'new.dt' is used uninitialized in this function.

osd_compat.c:162: 'new.dt' is declared
osd_compat.c:179: 'new.dt' is used, but is uninitialized.

osd_compat.c:354: 'new.dt' is declared
osd_compat.c:382: 'new.dt' is used, but is uninitialized.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: Ic37b0fd93a83d5d1a9270fd41b8bfec2f08d4b2a
Reviewed-on: http://review.whamcloud.com/10614
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-4629 llite: Fix uninitialized variable

'f.f_flags' might be used uninitialized in this function.

xattr.c:248: 'f.f_flags' is declared.
xattr.c:244: lump!= ( (void* )0) is true
xattr.c:254: 'f.f_flags' is used, but is uninitialized.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I99a3679b99f2980b6e78ebfb32dfa34e047c9756
Reviewed-on: http://review.whamcloud.com/10663
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4524 ldlm: improve ldlm_lock_create() return value

ldlm_lock_create() and ldlm_resource_get() always return NULL as
error reporting and "NULL" is interpretted as ENOMEM incorrectly
sometimes.
This patch fixes this problem by using ERR_PTR() rather than NULL.

Signed-off-by: Emoly Liu <emoly.liu@intel.com>
Change-Id: Ifa2e9494406617c9d29c0463cd9fcffba36cc5ae
Reviewed-on: http://review.whamcloud.com/9004
Reviewed-by: Bobi Jam <bobijam@gmail.com>
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-4824 utils: lfs find should continue after errors

'lfs find' stops as soon as it encounters an error, such as EACCES.
Change the behavior to match the regular find command: just note the
failure but continue on, returning a non-zero exit code at the end.

Signed-off-by: Matt Ezell <ezellma@ornl.gov>
Change-Id: I16ca35ec193e36134e7b93d91a20ff1d0778fe60
Reviewed-on: http://review.whamcloud.com/9794
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@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>
LU-3962 utils: improve names of iokit tools

Some of the names of scripts in the lustre-iokit package are very
generic and may easily cause confusion for users, or conflict with
other installations.  Rename them to more unique names and update
the files that reference them.

Fix whitespace in renamed files.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I733428467e5604bf9db916491e041253323ebbe5
Reviewed-on: http://review.whamcloud.com/10183
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>