Whamcloud - gitweb
LU-867 ptlrpc: Resolve section mismatch
authorBobi Jam <bobijam@whamcloud.com>
Sat, 5 Nov 2011 07:55:39 +0000 (15:55 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 4 Jan 2012 14:36:07 +0000 (09:36 -0500)
commit30d23e8d36d8b0b4d2571e7801e3643b0e7ab22e
treeb0ef3ca8b51760456240ed63bfeea51e80848529
parent82b79742c8e86650d1441828ef727c21e88faff8
LU-867 ptlrpc: Resolve section mismatch

The __init and __exit attributes appear to have been over used for
the ptlrpc module.  They should only be attached to ptlrpc_init and
ptlrpc_exit respectively and those functions should call the required
cleanup functions.  By using the attributes too broadly the following
section mismatch warning with be hit.  This indentifies cases where
your calling an __exit function from an __init function which is in
the wrong section.

WARNING: ~/src/git/lustre/lustre/ptlrpc/ptlrpc.o(.init.text+0x354):

Section mismatch in reference from the function ptlrpc_init() to the
function .exit.text:sptlrpc_fini() The function __init ptlrpc_init()
references a function __exit sptlrpc_fini().

This is often seen when error handling in the init function uses
functionality in the exit path.  The fix is often to remove the
__exit annotation of sptlrpc_fini() so it may be used outside an
exit section.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I94a4cb5fb7deea41fce5ee939470dc2e40908f98
Reviewed-on: http://review.whamcloud.com/1653
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ldlm/ldlm_lockd.c
lustre/ptlrpc/ptlrpc_internal.h
lustre/ptlrpc/sec.c