Re: [NFS] [PATCH 000 of 4] knfsd: Introduction

From: Neil Brown
Date: Wed Aug 02 2006 - 21:20:19 EST


On Friday July 28, bfields@xxxxxxxxxxxx wrote:
> On Fri, Jul 28, 2006 at 03:09:40PM +1000, NeilBrown wrote:
> > Following are 4 patches for knfsd in 2.6-mm-latest. They address some
> > issues found by Bruce Fields greatly appreciated patch review. Thanks Bruce.
> > They (like the patches they build on) are *not* 2.6.18 material.
>
> By the way, the one thing that looked to me like a real bug was the
> failure to do a lockd_down() when the user deletes a socket (comments
> resent below), which these patches don't seem to deal with. Of course,
> it's entirely possible I just didn't understand something....
>

Ofcourse, it is also entirely possible that you understand perfectly,
and that seems to be the case here. If the svc_sock_names call in
write_ports returns success, we should do a 'lockd_down' - and make
sure it does return success only if the close succeeded.


> --b.
>
>
> On Tue, Jul 25, 2006 at 11:55:08AM +1000, NeilBrown wrote:
> > + err = nfsd_create_serv();
> > + if (!err) {
> > + int proto = 0;
> > + err = svc_addsock(nfsd_serv, fd, buf, &proto);
> > + /* Decrease the count, but don't shutdown the
> > + * the service
> > + */
> > + if (err >= 0)
> > + lockd_up(proto);
> > + nfsd_serv->sv_nrthreads--;
> ....
> > @@ -211,8 +211,6 @@ static inline int nfsd_create_serv(void)
> > nfsd_last_thread);
> > if (nfsd_serv == NULL)
> > err = -ENOMEM;
> > - else
> > - nfsd_serv->sv_nrthreads++;
>
> I don't understand these sv_nrthreads changes.
>

The first is simply to counter the reference that was gained in
nfsd_create_serv.

The second chunk (removing sv_nrthread++) is fixing a bug in an
earlier patch. We never should have had that ++ there, as
'svc_create' created the object with a reference already.

Thanks,
NeilBrown
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/