On Thu, Jan 11, 2024 at 01:54:02PM -0700, Todd C. Miller wrote:
> On Thu, 11 Jan 2024 19:35:23 +0000, Miod Vallat wrote:
> 
> > Yes. Unfortunately NEEDQ and DISCONN may be both set, so we still need
> > to check for DISCONN here before NEEDQ.
> >
> > Or the whole block could become
> >
> >     if (NEEDQ set and not DISCONN set)
> >             nfsrv_rcv block
> >     if (DISCONN set)
> >             nfsrv_zapsock
> 
> Or just:
> 
>       if (DISCONN set)
>               nfsrv_zapsock
>       if (NEEDQ set)
>               nfsrv_rcv block
> 
> since nfsrv_zapsock will clear slp->ns_flag.
> 

nfsrv_rcv() may set the DISCONN flag, so we need to retest for it
after nfsrv_rcv() and possibly call nfsrv_zapsock(). If we don't do
that, the server may sleep before the nfsrv_zapsock() call; if so,
this leaves the connection half-open, which is the cause of the Linux
clients freezes.

Reply via email to