linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: Pavel Emelyanov <xemul@parallels.com>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH v2 9/13] sunrpc: Merge the xs_bind code
Date: Mon, 18 Oct 2010 17:43:05 -0400	[thread overview]
Message-ID: <20101018214305.GE4740@fieldses.org> (raw)
In-Reply-To: <20101018211537.GC4740@fieldses.org>

On Mon, Oct 18, 2010 at 05:15:37PM -0400, J. Bruce Fields wrote:
> On Fri, Oct 15, 2010 at 02:11:29PM -0400, Chuck Lever wrote:
> > 
> > On Oct 15, 2010, at 2:08 PM, J. Bruce Fields wrote:
> > 
> > > On Fri, Oct 15, 2010 at 12:39:36PM -0400, Chuck Lever wrote:
> > >> 
> > >> On Oct 15, 2010, at 12:05 PM, J. Bruce Fields wrote:
> > >> 
> > >>> On Tue, Oct 05, 2010 at 03:53:08PM +0400, Pavel Emelyanov wrote:
> > >>>> There's the only difference betseen the xs_bind4 and the
> > >>>> xs_bind6 - the size of sockaddr structure they use.
> > >>>> 
> > >>>> Fortunatelly its size can be indirectly get from the transport.
> > >>>> 
> > >>>> Change since v1:
> > >>>> * use sockaddr_storage instead of sockaddr
> > >>>> * use rpc_set_port instead of manual port assigning
> > >>> 
> > >>> Whoops, dropping this; it breaks nfsd startup.  I haven't figured out
> > >>> why yet, but I get
> > >>> 
> > >>> RPC: server localhost requires stronger authentication.
> > >>> svc: failed to register nfsdv2 RPC service (errno 13).
> > >> 
> > >> Capturing a network trace of lo during server initialization should reveal all.  Compare a trace from a working run and a non-working one.
> > > 
> > > Hm.  One difference is the source port of the portmap calls: 33471 in
> > > the bad case, 1016 in the bad.--b.
> > 
> > 1016 in the good... yes, that's because the server's registration upcall needs a privileged port, and xs_bind is not obliging here.  That certainly would result in a "requires stronger authentication" error from rpcbind.
> 
> So, adding some printk's: the problem is that the patch assumes that the
> trasnport->xprt.addrlen and transport->srcaddr.ss_family have been
> initialized at this point.  But they haven't been.  I don't know where
> that's supposed to happen.

Sorry, I meant just the family, the length seems fine.

I'll just fold this into the relevant patches and push out the result if
nobody objects.

--b.

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 8dc287f..324d97a 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1625,6 +1625,7 @@ static struct socket *xs_create_sock(struct rpc_xprt *xprt,
 				protocol, -err);
 		goto out;
 	}
+	transport->srcaddr.ss_family = family;
 	xs_reclassify_socket(family, sock);
 
 	if (xs_bind(transport, sock)) {

  reply	other threads:[~2010-10-18 21:43 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-04 12:50 [PATCH 0/13] sunrpc: Compact the xprtsock code a bit Pavel Emelyanov
2010-10-04 12:51 ` [PATCH 1/13] sunrpc: Remove unused sock arg from xs_get_srcport Pavel Emelyanov
2010-10-04 12:51 ` [PATCH 2/13] sunrpc: Remove unused sock arg from xs_next_srcport Pavel Emelyanov
2010-10-04 12:52 ` [PATCH 3/13] sunrpc: Get xprt pointer once in xs_tcp_setup_socket Pavel Emelyanov
2010-10-04 12:52 ` [PATCH 4/13] sunrpc: Remove duplicate xprt/transport arguments from calls Pavel Emelyanov
2010-10-04 12:53 ` [PATCH 5/13] sunrpc: Factor out udp sockets creation Pavel Emelyanov
2010-10-04 12:54 ` [PATCH 6/13] sunrpc: Factor out v4 " Pavel Emelyanov
2010-10-04 12:54 ` [PATCH 7/13] sunrpc: Factor out v6 " Pavel Emelyanov
2010-10-04 12:55 ` [PATCH 8/13] sunrpc: Call xs_create_sockX directly from setup_socket Pavel Emelyanov
2010-10-04 12:56 ` [PATCH 9/13] sunrpc: Merge the xs_bind code Pavel Emelyanov
2010-10-05  3:20   ` Chuck Lever
2010-10-05  5:42     ` Pavel Emelyanov
2010-10-05 11:53       ` [PATCH v2 " Pavel Emelyanov
2010-10-06  3:04         ` Chuck Lever
2010-10-15 16:05         ` J. Bruce Fields
2010-10-15 16:24           ` Pavel Emelyanov
2010-10-15 16:39           ` Chuck Lever
2010-10-15 18:08             ` J. Bruce Fields
2010-10-15 18:09               ` J. Bruce Fields
2010-10-15 18:11               ` Chuck Lever
2010-10-18 21:15                 ` J. Bruce Fields
2010-10-18 21:43                   ` J. Bruce Fields [this message]
2010-10-18 21:53                     ` Chuck Lever
2010-10-18 21:57                       ` J. Bruce Fields
2010-10-18 22:37                         ` Chuck Lever
2010-10-18 23:55                           ` J. Bruce Fields
2010-10-19 14:35                             ` Chuck Lever
2010-10-19 15:20                               ` J. Bruce Fields
2010-10-20  9:19                                 ` Pavel Emelyanov
2010-10-04 12:56 ` [PATCH 10/13] sunrpc: Merge xs_create_sock code Pavel Emelyanov
2010-10-04 12:57 ` [PATCH 11/13] sunrpc: Pass family to setup_socket calls Pavel Emelyanov
2010-10-04 12:57 ` [PATCH 12/13] sunrpc: Remove TCP worker wrappers Pavel Emelyanov
2010-10-04 12:58 ` [PATCH 13/13] sunrpc: Remove UDP " Pavel Emelyanov
2010-10-11 23:47 ` [PATCH 0/13] sunrpc: Compact the xprtsock code a bit J. Bruce Fields
2010-10-12  7:51   ` Pavel Emelyanov
2010-10-12 13:50     ` J. Bruce Fields
2010-10-12 15:21       ` Pavel Emelyanov
2010-10-15 15:03         ` J. Bruce Fields

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=20101018214305.GE4740@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=xemul@parallels.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;
as well as URLs for NNTP newsgroup(s).