From: maxim Date: Thu, 22 Oct 2009 10:40:20 +0000 (+0000) Subject: b=20897 X-Git-Tag: v1_9_290~4 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=c96f6a1a165304911ce2e0fb61e471c0f15f2207 b=20897 i=isaac i=maxim Fix for conn race when create_conn creates conn and add it to peer's list, releases global lock, gets a comm error, acquires the lock again and attempts to close the conn while it could be closed by some other thread. --- diff --git a/lnet/ChangeLog b/lnet/ChangeLog index 1114bd9..0f430a1 100644 --- a/lnet/ChangeLog +++ b/lnet/ChangeLog @@ -18,6 +18,12 @@ Description: Details : Severity : normal +Bugzilla : 20897 +Description: ksocknal_close_conn_locked connection race +Details : A race was possible when ksocknal_create_conn calls + ksocknal_close_conn_locked for already closed conn. + +Severity : normal Bugzilla : 18102 Description: router_proc.c is rewritten to use sysctl-interface for parameters residing in /proc/sys/lnet diff --git a/lnet/klnds/socklnd/socklnd.c b/lnet/klnds/socklnd/socklnd.c index 3841b08..a616be1 100644 --- a/lnet/klnds/socklnd/socklnd.c +++ b/lnet/klnds/socklnd/socklnd.c @@ -1345,7 +1345,10 @@ ksocknal_create_conn (lnet_ni_t *ni, ksock_route_t *route, if (rc != 0) { cfs_write_lock_bh(global_lock); - ksocknal_close_conn_locked(conn, rc); + if (!conn->ksnc_closing) { + /* could be closed by another thread */ + ksocknal_close_conn_locked(conn, rc); + } cfs_write_unlock_bh(global_lock); } else if (ksocknal_connsock_addref(conn) == 0) { /* Allow I/O to proceed. */