RE: [PATCH V4 1/6] IB Netlink Infrastructure

Nir Muchtar
2011-05-12T14:51:13Z

> -----Original Message-----
> From: Roland Dreier [mailto:roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org]
> Sent: Monday, May 09, 2011 10:35 PM
> To: Nir Muchtar
> Cc: rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org; linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Subject: Re: [PATCH V4 1/6] IB Netlink Infrastructure
>
> > +int ibnl_add_client(int index, int nops,
> > +                   const struct ibnl_client_cbs cb_table[])
> > +{
> > +       struct ibnl_client *cur;
> > +       struct ibnl_client *nl_client = kmalloc(sizeof *nl_client,
> GFP_ATOMIC);
> > +
> > +       if (!nl_client)
> > +               return -ENOMEM;
> > +       nl_client->index = index;
> > +       nl_client->nops = nops;
> > +       nl_client->cb_table = cb_table;
> > +       mutex_lock(&ibnl_mutex);
>
> quick question: why is GFP_ATOMIC used here? It seems that since the
> function later does mutex_lock(), there can't be any problem with
> sleeping.
>
> - R.

No reason. Typo...Thanks. I'll fix and resend.

Nir