2008-08-22 16:44:42

by Chuck Lever

[permalink] [raw]
Subject: [PATCH 5/5] lockd: Add address family-agnostic helper for zeroing the port number

Signed-off-by: Chuck Lever <[email protected]>
---

fs/lockd/host.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index 55ef751..3f0c1a8 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -39,6 +39,18 @@ static struct nsm_handle * nsm_find(const struct sockaddr_in *sin,
const char *hostname,
unsigned int hostname_len);

+static void nlm_clear_port(struct sockaddr *sap)
+{
+ switch (sap->sa_family) {
+ case AF_INET:
+ ((struct sockaddr_in *)sap)->sin_port = 0;
+ break;
+ case AF_INET6:
+ ((struct sockaddr_in6 *)sap)->sin6_port = 0;
+ break;
+ }
+}
+
static void nlm_display_address(const struct sockaddr *sap,
char *buf, const size_t len)
{
@@ -149,7 +161,7 @@ static struct nlm_host *nlm_lookup_host(int server,
}
host->h_name = nsm->sm_name;
host->h_addr = *sin;
- host->h_addr.sin_port = 0; /* ouch! */
+ nlm_clear_port((struct sockaddr *)&host->h_addr);
host->h_saddr = *ssin;
host->h_version = version;
host->h_proto = proto;



2008-08-27 13:55:30

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [PATCH 5/5] lockd: Add address family-agnostic helper for zeroing the port number

On Tue, Aug 26, 2008 at 03:56:12PM -0400, Chuck Lever wrote:
> On Aug 26, 2008, at Aug 26, 2008, 3:17 PM, J. Bruce Fields wrote:
>> On Tue, Aug 26, 2008 at 03:03:19PM -0400, bfields wrote:
>>> It would be nice if not necessary just to move nfs_set_port()
>>> somewhere
>>> common and use that (maybe with a more generic name).
>>>
>>> That aside, all 5 patches are OK by me.
>>
>> Provisionally applied all but the first (purely client-side) patch to
>>
>> git://linux-nfs.org/~bfields/linux.git for-2.6.28
>>
>> Do you have any good regression tests for nsm?
>
> Netapp is providing some testing resources. Their lock recovery tests
> provide some test coverage, but I don't know details.

OK. If they've got it in a form that's easy to distribute and use I'd
like to be able to run something like that here to test some of my work
in progress.

> One of the issues on the list for the Austin bake-a-thon is to review
> our test coverage, and see if we can flesh this out more.

I won't be able to make it to Austin but I'll be interested in whatever
you find out.

--b.

2008-08-27 18:39:34

by Chuck Lever

[permalink] [raw]
Subject: Re: [PATCH 5/5] lockd: Add address family-agnostic helper for zeroing the port number

On Aug 27, 2008, at Aug 27, 2008, 9:55 AM, J. Bruce Fields wrote:
> On Tue, Aug 26, 2008 at 03:56:12PM -0400, Chuck Lever wrote:
>> On Aug 26, 2008, at Aug 26, 2008, 3:17 PM, J. Bruce Fields wrote:
>>> On Tue, Aug 26, 2008 at 03:03:19PM -0400, bfields wrote:
>>>> It would be nice if not necessary just to move nfs_set_port()
>>>> somewhere
>>>> common and use that (maybe with a more generic name).
>>>>
>>>> That aside, all 5 patches are OK by me.
>>>
>>> Provisionally applied all but the first (purely client-side) patch
>>> to
>>>
>>> git://linux-nfs.org/~bfields/linux.git for-2.6.28
>>>
>>> Do you have any good regression tests for nsm?
>>
>> Netapp is providing some testing resources. Their lock recovery
>> tests
>> provide some test coverage, but I don't know details.
>
> OK. If they've got it in a form that's easy to distribute and use I'd
> like to be able to run something like that here to test some of my
> work
> in progress.

I believe it is still under development, and I don't know if they had
plans to package and support it outside of their Q/A team. I agree
that it would be useful for the community at large.

>> One of the issues on the list for the Austin bake-a-thon is to review
>> our test coverage, and see if we can flesh this out more.
>
> I won't be able to make it to Austin but I'll be interested in
> whatever
> you find out.

No problem.

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

2008-08-26 19:03:43

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [PATCH 5/5] lockd: Add address family-agnostic helper for zeroing the port number

It would be nice if not necessary just to move nfs_set_port() somewhere
common and use that (maybe with a more generic name).

That aside, all 5 patches are OK by me.

--b.

On Fri, Aug 22, 2008 at 12:42:33PM -0400, Chuck Lever wrote:
> Signed-off-by: Chuck Lever <[email protected]>
> ---
>
> fs/lockd/host.c | 14 +++++++++++++-
> 1 files changed, 13 insertions(+), 1 deletions(-)
>
> diff --git a/fs/lockd/host.c b/fs/lockd/host.c
> index 55ef751..3f0c1a8 100644
> --- a/fs/lockd/host.c
> +++ b/fs/lockd/host.c
> @@ -39,6 +39,18 @@ static struct nsm_handle * nsm_find(const struct sockaddr_in *sin,
> const char *hostname,
> unsigned int hostname_len);
>
> +static void nlm_clear_port(struct sockaddr *sap)
> +{
> + switch (sap->sa_family) {
> + case AF_INET:
> + ((struct sockaddr_in *)sap)->sin_port = 0;
> + break;
> + case AF_INET6:
> + ((struct sockaddr_in6 *)sap)->sin6_port = 0;
> + break;
> + }
> +}
> +
> static void nlm_display_address(const struct sockaddr *sap,
> char *buf, const size_t len)
> {
> @@ -149,7 +161,7 @@ static struct nlm_host *nlm_lookup_host(int server,
> }
> host->h_name = nsm->sm_name;
> host->h_addr = *sin;
> - host->h_addr.sin_port = 0; /* ouch! */
> + nlm_clear_port((struct sockaddr *)&host->h_addr);
> host->h_saddr = *ssin;
> host->h_version = version;
> host->h_proto = proto;
>

2008-08-26 19:18:01

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [PATCH 5/5] lockd: Add address family-agnostic helper for zeroing the port number

On Tue, Aug 26, 2008 at 03:03:19PM -0400, bfields wrote:
> It would be nice if not necessary just to move nfs_set_port() somewhere
> common and use that (maybe with a more generic name).
>
> That aside, all 5 patches are OK by me.

Provisionally applied all but the first (purely client-side) patch to

git://linux-nfs.org/~bfields/linux.git for-2.6.28

Do you have any good regression tests for nsm?

--b.

2008-08-26 19:51:07

by Chuck Lever

[permalink] [raw]
Subject: Re: [PATCH 5/5] lockd: Add address family-agnostic helper for zeroing the port number

On Aug 26, 2008, at Aug 26, 2008, 3:03 PM, J. Bruce Fields wrote:
> It would be nice if not necessary just to move nfs_set_port()
> somewhere
> common and use that (maybe with a more generic name).

I agree. However...

As we round out to a full IPv6 implementation for NFS, it will become
clear what additional helper functions can be shared. This might
include not only a port setting helper, but also one that can
construct presentation format addresses, and so on.

At that point, we can consolidate as needed.

Until then, I would like to wait until everything is reviewed and
integrated so we are sure to include changes and updates related to
the review process, if that's OK with you.

> On Fri, Aug 22, 2008 at 12:42:33PM -0400, Chuck Lever wrote:
>> Signed-off-by: Chuck Lever <[email protected]>
>> ---
>>
>> fs/lockd/host.c | 14 +++++++++++++-
>> 1 files changed, 13 insertions(+), 1 deletions(-)
>>
>> diff --git a/fs/lockd/host.c b/fs/lockd/host.c
>> index 55ef751..3f0c1a8 100644
>> --- a/fs/lockd/host.c
>> +++ b/fs/lockd/host.c
>> @@ -39,6 +39,18 @@ static struct nsm_handle * nsm_find(const struct
>> sockaddr_in *sin,
>> const char *hostname,
>> unsigned int hostname_len);
>>
>> +static void nlm_clear_port(struct sockaddr *sap)
>> +{
>> + switch (sap->sa_family) {
>> + case AF_INET:
>> + ((struct sockaddr_in *)sap)->sin_port = 0;
>> + break;
>> + case AF_INET6:
>> + ((struct sockaddr_in6 *)sap)->sin6_port = 0;
>> + break;
>> + }
>> +}
>> +
>> static void nlm_display_address(const struct sockaddr *sap,
>> char *buf, const size_t len)
>> {
>> @@ -149,7 +161,7 @@ static struct nlm_host *nlm_lookup_host(int
>> server,
>> }
>> host->h_name = nsm->sm_name;
>> host->h_addr = *sin;
>> - host->h_addr.sin_port = 0; /* ouch! */
>> + nlm_clear_port((struct sockaddr *)&host->h_addr);
>> host->h_saddr = *ssin;
>> host->h_version = version;
>> host->h_proto = proto;
>>

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com





2008-08-26 19:57:01

by Chuck Lever

[permalink] [raw]
Subject: Re: [PATCH 5/5] lockd: Add address family-agnostic helper for zeroing the port number

On Aug 26, 2008, at Aug 26, 2008, 3:17 PM, J. Bruce Fields wrote:
> On Tue, Aug 26, 2008 at 03:03:19PM -0400, bfields wrote:
>> It would be nice if not necessary just to move nfs_set_port()
>> somewhere
>> common and use that (maybe with a more generic name).
>>
>> That aside, all 5 patches are OK by me.
>
> Provisionally applied all but the first (purely client-side) patch to
>
> git://linux-nfs.org/~bfields/linux.git for-2.6.28
>
> Do you have any good regression tests for nsm?

Netapp is providing some testing resources. Their lock recovery tests
provide some test coverage, but I don't know details.

One of the issues on the list for the Austin bake-a-thon is to review
our test coverage, and see if we can flesh this out more.

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com