From: Jeff Layton <jlayton@redhat.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: linux-nfs@vger.kernel.org, steved@redhat.com
Subject: Re: [PATCH 5/6] nfs-utils: add IPv6 support to nfsd
Date: Tue, 2 Jun 2009 14:55:37 -0400 [thread overview]
Message-ID: <20090602145537.04fdec57@tlielax.poochiereds.net> (raw)
In-Reply-To: <8CA624B3-9BA6-4110-8A9B-CFF50B70A288@oracle.com>
On Tue, 2 Jun 2009 11:35:18 -0400
Chuck Lever <chuck.lever@oracle.com> wrote:
Forgot a couple of comments from the earlier email:
> > case 'H':
> > - if (inet_addr(optarg) != INADDR_NONE) {
> > + /*
> > + * for now, this only handles one -H option. Use the
> > + * first one specified.
> > + */
>
> Interesting comment. Did the old version allow you to specify more
> than one? Can you run rpc.nfsd more than once, specifying a different
> "-H" on each?
The only option that matters once nfsd is up is the number of threads
-- any others are ignored. This applies to the -H option as well, so
it'll only matter for the first run of rpc.nfsd. You could specify -H
multiple times on a single nfsd run, but only the last one would
matter. With this patch, I changed it to be the first one since that
seemed more intuitive to me.
We could eventually allow nfsd to take multiple -H arguments, but
that's really outside the scope of this set.
> > +
> > + xlog_open("nfsd");
>
> How about "rpc.nfsd" or even argv[0] ?
rpc.nfsd is probably easier. basename(argv[0]) is probably the best
thing though. I'll fix it up to use that.
> > + /*
> > + * KLUDGE ALERT:
> > + * Some kernels let nfsd kernel threads inherit open files
> > + * from the program that spawns them (i.e. us). So close
> > + * everything before spawning kernel threads. --Chip
> > + */
> > xlog_syslog(1);
> > xlog_stderr(0);
> > fd = open("/dev/null", O_RDWR);
> > if (fd == -1)
> > - perror("/dev/null");
> > + xlog(L_ERROR, "unable to open /dev/null: %s", strerror(errno));
>
> ("%m") does the same thing as ("%s", strerror(errno))
>
Nice...ok I'll change it (and other spots if there are any).
> >
> > else {
> > (void) dup2(fd, 0);
> > (void) dup2(fd, 1);
>
> Should you check the return code from these?
>
The existing code doesn't. If we want to change that it should prob be
a separate patch. I wonder though whether we need to do all of this
stuff with /dev/null. Stupid question: is there some reason we can't
just close stdin/stdout/stderr?
--
Jeff Layton <jlayton@redhat.com>
next prev parent reply other threads:[~2009-06-02 18:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-02 11:43 [PATCH 0/6] nfs-utils: add IPv6 support for rpc.nfsd (try #4) Jeff Layton
2009-06-02 11:43 ` [PATCH 1/6] nfs-utils: don't link libexport.a and libmisc.a to nfsd Jeff Layton
2009-06-02 11:43 ` [PATCH 2/6] nfs-utils: clean up option parsing in nfsd.c Jeff Layton
2009-06-02 11:43 ` [PATCH 3/6] nfs-utils: break up nfssvc.c into more individually callable functions Jeff Layton
2009-06-02 15:32 ` Chuck Lever
2009-06-02 18:40 ` Jeff Layton
2009-06-02 11:43 ` [PATCH 4/6] nfs-utils: set IPV6_V6ONLY on nfssvc IPv6 sockets Jeff Layton
2009-06-02 11:43 ` [PATCH 5/6] nfs-utils: add IPv6 support to nfsd Jeff Layton
2009-06-02 15:35 ` Chuck Lever
2009-06-02 18:55 ` Jeff Layton [this message]
[not found] ` <20090602145537.04fdec57-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2009-06-02 19:13 ` Chuck Lever
2009-06-02 20:04 ` Jeff Layton
2009-06-02 11:43 ` [PATCH 6/6] nfs-utils: update the nfsd manpage Jeff Layton
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=20090602145537.04fdec57@tlielax.poochiereds.net \
--to=jlayton@redhat.com \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=steved@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox