LU-3066 llite: fix crash in fdatasync(directory)

kernel NULL pointer dereference for fdatasync(directory)

fd = open("/mnt/lustre", O_RDONLY|O_NONBLOCK|O_DIRECTORY);
fdatasync(fd);
close(fd);

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: Ib14b25d1694131e1a65373654008b7f337ce959e
Reviewed-on: http://review.whamcloud.com/5886
Tested-by: Hudson
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3068 build: fix 'incorrect expression' errors

Fix 'program hangs' defects found by Coverity version 6.5.1:
Array compared against 0 (NO_EFFECT)
Comparing an array to null is not useful.
Copy-paste error (COPY_PASTE_ERROR)
This line looks like a copy-paste error.
Self assignment (NO_EFFECT)
Assignment operation has no effect.
Side effect in assertion (ASSERT_SIDE_EFFECT)
Assignment has a side effect. This code will work differently in a
non-debug build. You might have intended to use a comparison instead.
Wrong sizeof argument (SIZEOF_MISMATCH)
Passing argument is suspicious.

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: Icf6ea9632da6159beca0fd9fd3ff9bb57effc305
Reviewed-on: http://review.whamcloud.com/5887
Tested-by: Hudson
Reviewed-by: John Hammond <johnlockwoodhammond@gmail.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2790 ldlm: handle lvbo_init failure in ldlm_resource_get

Under some special cases, such as RAM pressure, lvbo_init()
may be failed, then the caller - ldlm_resource_get() should
handle the failure to prevent subsequent operations to use
non-exist resource.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I0eabbf5daaaba9aa163a45f24b6b621477ec4d32
Reviewed-on: http://review.whamcloud.com/5699
Tested-by: Hudson
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>