LU-2394 llog: Fix a NULL pointer dereference

If llog_cat_id2handle fails and returns a positive value, it may free
its 'res' parameter and set it to NULL. Thus, a caller must be cautious
not to cause a NULL pointer dereference on error.

This patch fixes the cat_cancel_cb function, keeping it from dereferencing
this potentially NULL pointer.

In addition, any console message regarding a failed call to
llog_cat_id2handle in llog_cat.c now outputs the same message.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Change-Id: I949b558d0ea4569685e8ed85b7a920b2dca548c3
Reviewed-on: http://review.whamcloud.com/4676
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
LU-1565 ptlrpc: resend CANCEL rpc

it is better to deliver CANCEL rpc to server reliably in the case of:
    RPC timeout, re-connect, CANCEL resend
because server may have sent BL AST and is waiting for this CANCEL.
this avoids possible idle time on server and later client evictions.

CANCEL is always has up-todate lock handle or both enqueue and cancel
are not replayed on recovery, with the exception of the case of:
    BL AST is sent; recovery starts, lock is re-enqueued, BL AST comes
    to client, cancel is created, recovery ends (lock handle has
    changed), CANCEL is sent, its reply gets estale as lock handled is
    not updated in the RPC.
this case is left unfixed and still may result in lock callback
timeout and client eviction, but this race window is much much shorter
than the target case being fixed by this fix.

Also remove lock cancelling from client_common_put_super() as it is
done later in client_disconnect_export().

Change-Id: I1bfe70444299d93c3fb348b737cb9721ea63eda3
Signed-off-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Reviewed-by: Alexey Lyashkov <alexey_lyashkov@xyratex.com>
Reviewed-by: Andrew Perepechko <Andrew_Perepechko@xyratex.com>
Xyratex-bug-id: MRP-477
Reviewed-on: http://review.whamcloud.com/3189
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1876 hsm: bugfix about layout lock on the client

The following issues are fixed in this patch:
* deadlock at add_lsmref
* lov_delete_raid0 should wait for refcount of lsm to be zero
* handle empty layout at lov layer since layout can be changed
  anytime so original assumption of skipping lov layer when lsm is
  NULL is no longer correct
* other fixes

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: Ie7cd744b188f4d28fdbebda8870259b931328d00
Reviewed-on: http://review.whamcloud.com/4416
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-1199 build: Fix style and indention in build system files

Fix indentation by replacing spaces with tabs.

Remove stray whitespace at end of lines.

Command substitution changed from `...` notation to $(...) notation.
The latter is part of the POSIX 1003.2, and is supported by Debian's
dash shell, so it is relativly portable these days.

build/Makefile is checked in to git, not auto-generated by the
build system.  Therefore a !Makefile exception is added to
build/.gitignore.

Also, in build/autogen.sh, fix default setting of the IFS variable
to be a space and a tab, rather than 9 spaces.  I believe the 9
spaces were a result of a bad cut-and-paste.

Change-Id: I46270d808d7fe036f748da1cb45826bb42ab01e2
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/4677
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Brian J. Murrell <brian.murrell@intel.com>
LU-1199 build: Remove obsolete ext3 check

Remove the check for journal_callback_set() which was only needed
for ext3.

Also correct a couple of comments that still mentioned "ext3".

Change-Id: I0b4362eb1171051589f3772ddc253fa249019e6b
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/4678
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Brian J. Murrell <brian.murrell@intel.com>
LU-1199 build: Remove obsolete check for 2.4 kernels

Remove check for 2.4 kernels, which are no longer supported.

Change-Id: I4ed5b7c2686fa9b0c104444853e45900f90e1eb8
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/4679
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Brian J. Murrell <brian.murrell@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-1199 build: Remove check for obsolete compilers

The bad compilers that we were checking for are no longer in
use.

Change-Id: I754c8d23ef6547448ecc4b502ce6cf058d98f11c
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/4680
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Brian J. Murrell <brian.murrell@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-2275 mdc: Don't leak requests with "strange" dispositions

Make sure that a request with no transno will get its rq_replay reset,
also ensure that on error path from ll_file_open we drop reference to
request occupied by open if needed.

Change-Id: If4d59274d2574698567970821b94ef1c5c35385b
Signed-off-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/4458
Reviewed-by: Peng Tao <bergwolf@gmail.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>