All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Neil Brown <neilb@cse.unsw.edu.au>
Cc: nfs@lists.sourceforge.net
Subject: Re: rpc.mountd stops functioning
Date: Fri, 27 Aug 2004 19:16:54 -0400	[thread overview]
Message-ID: <20040827231654.GA2836@fieldses.org> (raw)
In-Reply-To: <16686.43784.910598.870375@cse.unsw.edu.au>

On Fri, Aug 27, 2004 at 01:31:20PM +1000, Neil Brown wrote:
> I don't think this patch is needed (though it wouldn't actually break anything).
> The loop in svc_run.c starts:
> 
> 
> 		readfds = svc_fdset;
> 		cache_set_fds(&readfds);
> 
> so readfds is completely initialised at the top of the loop, so
> clearing something at the bottom (which is essentially what this patch
> does) should be a no-op.
> 
> Am I wrong?

Note that cache_process_req() (which the patch below modifies) is not
all the way at the bottom of the loop; there's still an importan call to
svc_getreqset() after it.

If I understand the problem correctly, what happens is that if select()
returns with a set that includes two file descriptors, the first for a
cache channel and the second for an rpc socket, and if we don't clear
the first file descriptor from that set before passing it to
svc_getreqset(), then the rpc code will try to read an rpc request from
a cache channel file, and will get very confused.

The symptom is that mountd may die occasionally on a server that's
using the new interface (hence mountd is handling upcalls), and that's
getting a lot of mount requests.

I've never seen the bug myself, because I'm almost always using nfsv4,
hence only use mountd to handle upcalls....

--b.


> > >From Garrick Staples <garrick@usc.edu>:
> > 
> > After mountd handles a cache upcall, we should clear the relevant bits in the
> > fd_set.
> > 
> > ---
> > 
> >  nfs-utils-1.0.6-bfields/utils/mountd/cache.c |    1 +
> >  1 files changed, 1 insertion(+)
> > 
> > diff -puN utils/mountd/cache.c~cache_select_bugfix utils/mountd/cache.c
> > --- nfs-utils-1.0.6/utils/mountd/cache.c~cache_select_bugfix	2004-07-14 12:52:57.000000000 -0400
> > +++ nfs-utils-1.0.6-bfields/utils/mountd/cache.c	2004-07-14 12:52:57.000000000 -0400
> > @@ -315,6 +315,7 @@ int cache_process_req(fd_set *readfds) 
> >  		    FD_ISSET(fileno(cachelist[i].f), readfds)) {
> >  			cnt++;
> >  			cachelist[i].cache_handle(cachelist[i].f);
> > +			FD_CLR(fileno(cachelist[i].f), readfds);
> >  		}
> >  	}
> >  	return cnt;
> > _
> > 
> > 
> > -------------------------------------------------------
> > This SF.Net email is sponsored by OSTG. Have you noticed the changes on
> > Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
> > one more big change to announce. We are now OSTG- Open Source Technology
> > Group. Come see the changes on the new OSTG site. www.ostg.com
> > _______________________________________________
> > NFS maillist  -  NFS@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/nfs


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

  reply	other threads:[~2004-08-27 23:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-05 11:19 rpc.mountd stops functioning Johan van den Dorpe
2004-08-05 11:55 ` Johan van den Dorpe
2004-11-25 12:45   ` Johan van den Dorpe
2004-08-05 14:46 ` J. Bruce Fields
2004-08-11 10:02   ` Johan van den Dorpe
2004-08-19 15:26   ` Johan van den Dorpe
2004-08-27  3:31   ` Neil Brown
2004-08-27 23:16     ` J. Bruce Fields [this message]
2004-08-28 17:20       ` Garrick Staples
2004-08-30  5:54       ` Neil Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040827231654.GA2836@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=neilb@cse.unsw.edu.au \
    --cc=nfs@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.