List Info

Thread: Patch for MXLND to enable lctl->peer_list




Patch for MXLND to enable lctl->peer_list
user name
2007-04-13 08:34:51
Hi Eric,

I have attached a patch to enable using peer_list in lctl.
The basic  
code was in there, I simply needed to set the correct return
value  
and add MXLND to the supported LNDs in
$LUSTRE/lnet/utils/portals.c.

It should apply with patch -p0 in $LUSTRE.

Regards,

Scott


_______________________________________________
Lustre-devel mailing list
Lustre-develclusterfs.com
https://mail.clusterfs.com/mailman/listinfo/lustre-devel


  
Re: Patch for MXLND to enable lctl->peer_list
user name
2007-04-13 10:01:53
Hi Eric,

I forgot to include one other small change. The corrected
patch is  
attached.

Scott


_______________________________________________
Lustre-devel mailing list
Lustre-develclusterfs.com
https://mail.clusterfs.com/mailman/listinfo/lustre-devel


  
Re: Patch for MXLND to enable lctl->peer_list
user name
2007-04-13 10:37:24
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
> Lustre-develclusterfs.com
> https://mail.clusterfs.com/mailman/listinfo/lustre-devel

-- 
Alexey Lyashkov <shadowclusterfs.com>
Beaver team

_______________________________________________
Lustre-devel mailing list
Lustre-develclusterfs.com
https://mail.clusterfs.com/mailman/listinfo/lustre-devel



Re: Patch for MXLND to enable lctl->peer_list
user name
2007-04-13 14:17:10
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 %sn",
                          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
>> Lustre-develclusterfs.com
>> https://mail.clusterfs.com/mailman/listinfo/lustre-devel

> -- 
> Alexey Lyashkov <shadowclusterfs.com>
> Beaver team

_______________________________________________
Lustre-devel mailing list
Lustre-develclusterfs.com
https://mail.clusterfs.com/mailman/listinfo/lustre-devel



Re: Patch for MXLND to enable lctl->peer_list
user name
2007-04-14 05:58:12
On Apr 14, 2007, at 3:41 AM, Alexey Lyashkov wrote:

> Scott,
>
> +			break;
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> need exit from loop.
> I think not need others loops after found data.

Trying to do too many things at once. 

Thanks again for the catch.

Would you like another patch or did you add the break?

Thanks,

Scott

_______________________________________________
Lustre-devel mailing list
Lustre-develclusterfs.com
https://mail.clusterfs.com/mailman/listinfo/lustre-devel



Re: Patch for MXLND to enable lctl->peer_list
user name
2007-04-14 09:05:51
On Apr 14, 2007  06:58 -0400, Scott Atchley wrote:
> On Apr 14, 2007, at 3:41 AM, Alexey Lyashkov wrote:
> >
> >+			break;
> >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >need exit from loop.
> >I think not need others loops after found data.
> 
> Trying to do too many things at once. 
> 
> Thanks again for the catch.
> 
> Would you like another patch or did you add the break?

Scott,
it would probably be best to attach the patch to a new bug
in bugzilla
and CC eebclusterfs.com, so that we can track its inclusion
into a 
release properly.

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.

_______________________________________________
Lustre-devel mailing list
Lustre-develclusterfs.com
https://mail.clusterfs.com/mailman/listinfo/lustre-devel



Re: Patch for MXLND to enable lctl->peer_list
user name
2007-04-14 09:26:57
On Apr 14, 2007, at 10:05 AM, Andreas Dilger wrote:

> Scott,
> it would probably be best to attach the patch to a new
bug in bugzilla
> and CC eebclusterfs.com, so that we can track its
inclusion into a
> release properly.
>
> Cheers, Andreas


Hi Andreas,

I will do this today.

Thanks,

Scott

_______________________________________________
Lustre-devel mailing list
Lustre-develclusterfs.com
https://mail.clusterfs.com/mailman/listinfo/lustre-devel



[1-7]

about | contact  Other archives ( Real Estate discussion Medical topics )