Linux NFS development
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: chucklever@gmail.com
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 2/7] lockd: Use sockaddr_storage for h_saddr field
Date: Fri, 12 Sep 2008 18:07:01 -0400	[thread overview]
Message-ID: <20080912220701.GH22126@fieldses.org> (raw)
In-Reply-To: <76bd70e30809112014m52af6961ja83522100203300b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Thu, Sep 11, 2008 at 11:14:39PM -0400, Chuck Lever wrote:
> On Thu, Sep 11, 2008 at 9:41 PM, J. Bruce Fields <bfields@fieldses.org> wrote:
> > On Wed, Sep 03, 2008 at 02:35:46PM -0400, Chuck Lever wrote:
> >> @@ -294,7 +294,7 @@ nlm_bind_host(struct nlm_host *host)
> >>                       .protocol       = host->h_proto,
> >>                       .address        = nlm_addr(host),
> >>                       .addrsize       = host->h_addrlen,
> >> -                     .saddress       = (struct sockaddr *)&host->h_saddr,
> >> +                     .saddress       = nlm_srcaddr(host),
> >
> > Just out of curiosity--in the patch 1 and 3, you also add a length
> > field.  Here you don't.  Why the difference?  None of the new length
> > fields seem to be used yet.
> 
> h_addrlen should be used in nlm_bind_host already in patch 1.

Whoops, yes, I missed the rpc_create_args assignment, thanks.

--b.

> When we
> get up to the NSM changes, sm_addrlen will be used in nsm_mon_unmon.
> 
> The source address is provided to rpc_create() only, which doesn't
> take an address length.
> 
> >>                       .timeout        = &timeparms,
> >>                       .servername     = host->h_name,
> >>                       .program        = &nlm_program,
> >> diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c
> >> index 198b4e5..d3d1330 100644
> >> --- a/fs/lockd/svcsubs.c
> >> +++ b/fs/lockd/svcsubs.c
> >> @@ -418,7 +418,7 @@ EXPORT_SYMBOL_GPL(nlmsvc_unlock_all_by_sb);
> >>  static int
> >>  nlmsvc_match_ip(void *datap, struct nlm_host *host)
> >>  {
> >> -     return nlm_cmp_addr(&host->h_saddr, datap);
> >> +     return nlm_cmp_addr(nlm_srcaddr_in(host), datap);
> >>  }
> >>
> >>  /**
> >> diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
> >> index 41d7a8e..964e6c9 100644
> >> --- a/include/linux/lockd/lockd.h
> >> +++ b/include/linux/lockd/lockd.h
> >> @@ -40,7 +40,7 @@ struct nlm_host {
> >>       struct hlist_node       h_hash;         /* doubly linked list */
> >>       struct sockaddr_storage h_addr;         /* peer address */
> >>       size_t                  h_addrlen;
> >> -     struct sockaddr_in      h_saddr;        /* our address (optional) */
> >> +     struct sockaddr_storage h_srcaddr;      /* our address (optional) */
> >>       struct rpc_clnt *       h_rpcclnt;      /* RPC client to talk to peer */
> >>       char *                  h_name;         /* remote hostname */
> >>       u32                     h_version;      /* interface version */
> >> @@ -64,7 +64,7 @@ struct nlm_host {
> >>       struct nsm_handle *     h_nsmhandle;    /* NSM status handle */
> >>
> >>       char                    h_addrbuf[48],  /* address eyecatchers */
> >> -                             h_saddrbuf[48];
> >> +                             h_srcaddrbuf[48];
> >>  };
> >>
> >>  struct nsm_handle {
> >> @@ -90,6 +90,16 @@ static inline struct sockaddr *nlm_addr(const struct nlm_host *host)
> >>       return (struct sockaddr *)&host->h_addr;
> >>  }
> >>
> >> +static inline struct sockaddr_in *nlm_srcaddr_in(const struct nlm_host *host)
> >> +{
> >> +     return (struct sockaddr_in *)&host->h_srcaddr;
> >> +}
> >> +
> >> +static inline struct sockaddr *nlm_srcaddr(const struct nlm_host *host)
> >> +{
> >> +     return (struct sockaddr *)&host->h_srcaddr;
> >> +}
> >> +
> >>  /*
> >>   * Map an fl_owner_t into a unique 32-bit "pid"
> >>   */
> >>
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >
> 
> 
> 
> -- 
> "If you simplify your English, you are freed from the worst follies of
> orthodoxy."
>  -- George Orwell

  parent reply	other threads:[~2008-09-12 22:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-03 18:35 [PATCH 0/7] More IPv6 support for lockd Chuck Lever
     [not found] ` <20080903183411.16867.33715.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2008-09-03 18:35   ` [PATCH 1/7] lockd: Use sockaddr_storage + length for h_addr field Chuck Lever
     [not found]     ` <20080903183539.16867.8416.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2008-09-04 17:46       ` J. Bruce Fields
2008-09-03 18:35   ` [PATCH 2/7] lockd: Use sockaddr_storage for h_saddr field Chuck Lever
     [not found]     ` <20080903183546.16867.90601.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2008-09-12  1:41       ` J. Bruce Fields
2008-09-12  3:14         ` Chuck Lever
     [not found]           ` <76bd70e30809112014m52af6961ja83522100203300b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-09-12 22:07             ` J. Bruce Fields [this message]
2008-09-03 18:35   ` [PATCH 3/7] NSM: Use sockaddr_storage for sm_addr field Chuck Lever
2008-09-03 18:36   ` [PATCH 4/7] lockd: Teach nlm_cmp_addr() to support AF_INET6 addresses Chuck Lever
2008-09-03 18:36   ` [PATCH 5/7] lockd: Support AF_INET6 when hashing addresses in nlm_lookup_host Chuck Lever
     [not found]     ` <20080903183608.16867.80962.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2008-09-12 21:59       ` J. Bruce Fields
2008-09-03 18:36   ` [PATCH 6/7] lockd: Combine __nsm_find() and nsm_find() Chuck Lever
     [not found]     ` <20080903183615.16867.58815.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2008-09-12 21:56       ` J. Bruce Fields
2008-09-03 18:36   ` [PATCH 7/7] lockd: Update nsm_find() to support non-AF_INET addresses Chuck Lever
2008-09-12 22:12   ` [PATCH 0/7] More IPv6 support for lockd 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=20080912220701.GH22126@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=chucklever@gmail.com \
    --cc=linux-nfs@vger.kernel.org \
    /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