Alexey,
Thanks for the catch. :-)
Rather than release the lock, let me set the return value and let it
exit in the usual point.
Scott
--- ../lustre-old/lnet/klnds/mxlnd/mxlnd.c 2007-02-09
19:04:46.000000000 -0500
+++ ./lnet/klnds/mxlnd/mxlnd.c 2007-04-13 10:59:06.000000000 -0400
@@ -579,7 +579,7 @@ mxlnd_init_mx(lnet_ni_t *ni)
mx_finalize();
return -1;
}
- mxret = mx_set_request_timeout(kmxlnd_data.kmx_endpt, NULL,
MXLND_COMM_TIMEOUT/HZ);
+ mxret = mx_set_request_timeout(kmxlnd_data.kmx_endpt, NULL,
MXLND_COMM_TIMEOUT/HZ*1000);
if (mxret != MX_SUCCESS) {
CERROR("mx_set_request_timeout() failed with %s\n",
mx_strerror(mxret));
diff -pru ../lustre-old/lnet/klnds/mxlnd/mxlnd_cb.c ./lnet/klnds/
mxlnd/mxlnd_cb.c
--- ../lustre-old/lnet/klnds/mxlnd/mxlnd_cb.c 2007-02-09
19:04:46.000000000 -0500
+++ ./lnet/klnds/mxlnd/mxlnd_cb.c 2007-04-13 15:16:29.000000000
-0400
@@ -1087,6 +1087,7 @@ int
mxlnd_get_peer_info(int index, lnet_nid_t *nidp, int *count)
{
int i = 0;
+ int ret = -ENOENT;
struct kmx_peer *peer = NULL;
struct kmx_conn *conn = NULL;
@@ -1099,11 +1100,12 @@ mxlnd_get_peer_info(int index, lnet_nid_
*nidp = peer->mxp_nid;
*count = atomic_read(&peer->mxp_refcount);
+ ret = 0;
}
}
read_unlock(&kmxlnd_data.kmx_peers_lock);
- return -ENOENT;
+ return ret;
}
void
diff -pru ../lustre-old/lnet/utils/portals.c ./lnet/utils/portals.c
--- ../lustre-old/lnet/utils/portals.c 2007-03-09 16:38:32.000000000
-0500
+++ ./lnet/utils/portals.c 2007-04-13 09:25:13.000000000 -0400
@@ -570,7 +570,7 @@ jt_ptl_print_peers (int argc, char **arg
int index;
int rc;
- if (!g_net_is_compatible (argv[0], SOCKLND, RALND, PTLLND,
+ if (!g_net_is_compatible (argv[0], SOCKLND, RALND, PTLLND,
MXLND,
OPENIBLND, CIBLND, IIBLND,
VIBLND, O2IBLND, 0))
return -1;
On Apr 13, 2007, at 11:37 AM, Alexey Lyashkov wrote:
this change is wrong.
you need read_unlock(&kmxlnd_data.kmx_peers_lock); before return from
mxlnd_get_peer_info to avoid leak lock.
diff -pru ../lustre-old/lnet/klnds/mxlnd/mxlnd_cb.c
./lnet/klnds/mxlnd/mxlnd_cb.c
--- ../lustre-old/lnet/klnds/mxlnd/mxlnd_cb.c 2007-02-09
19:04:46.000000000 -0500
+++ ./lnet/klnds/mxlnd/mxlnd_cb.c 2007-04-13 09:24:50.000000000
-0400
@@ -1099,6 +1099,7 @@ mxlnd_get_peer_info(int index, lnet_nid_
*nidp = peer->mxp_nid;
*count = atomic_read(&peer->mxp_refcount);
+ return 0;
}
}
read_unlock(&kmxlnd_data.kmx_peers_lock);
On Fri, 2007-04-13 at 18:01, Scott Atchley wrote:
Hi Eric,
I forgot to include one other small change. The corrected patch is
attached.
Scott
_____________________________________________________________________
_
_______________________________________________
Lustre-devel mailing list
[EMAIL PROTECTED]
https://mail.clusterfs.com/mailman/listinfo/lustre-devel
--
Alexey Lyashkov <[EMAIL PROTECTED]>
Beaver team
_______________________________________________
Lustre-devel mailing list
[EMAIL PROTECTED]
https://mail.clusterfs.com/mailman/listinfo/lustre-devel