* [PATCH 2/2] nfs4: fix comments in discover_server_trunking
[not found] <1390189537-9666-1-git-send-email-dros@primarydata.com>
@ 2014-01-20 3:45 ` Weston Andros Adamson
2014-01-20 4:20 ` Weston Andros Adamson
2014-01-20 23:32 ` [PATCH 1/2] nfs4: fix discover_server_trunking use after free Trond Myklebust
1 sibling, 1 reply; 4+ messages in thread
From: Weston Andros Adamson @ 2014-01-20 3:45 UTC (permalink / raw)
To: trond.myklebust; +Cc: linux-nfs, Weston Andros Adamson
'result' is not updated if a match isn't found in the
nfs4_discover_server_trunking path.
Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
---
fs/nfs/nfs4client.c | 4 ++--
fs/nfs/nfs4state.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 0f9b772..147a752 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -465,7 +465,7 @@ static void nfs4_swap_callback_idents(struct nfs_client *keep,
* nfs40_walk_client_list - Find server that recognizes a client ID
*
* @new: nfs_client with client ID to test
- * @result: OUT: found nfs_client, or new
+ * @result: OUT: found nfs_client
* @cred: credential to use for trunking test
*
* Returns zero, a negative errno, or a negative NFS4ERR status.
@@ -601,7 +601,7 @@ out_major_mismatch:
* nfs41_walk_client_list - Find nfs_client that matches a client/server owner
*
* @new: nfs_client with client ID to test
- * @result: OUT: found nfs_client, or new
+ * @result: OUT: found nfs_client
* @cred: credential to use for trunking test
*
* Returns zero, a negative errno, or a negative NFS4ERR status.
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index e5be725..666512e 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -328,7 +328,7 @@ out:
* nfs41_discover_server_trunking - Detect server IP address trunking (mv1)
*
* @clp: nfs_client under test
- * @result: OUT: found nfs_client, or clp
+ * @result: OUT: found nfs_client
* @cred: credential to use for trunking test
*
* Returns NFS4_OK, a negative errno, or a negative NFS4ERR status.
--
1.8.3.4 (Apple Git-47)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] nfs4: fix comments in discover_server_trunking
2014-01-20 3:45 ` [PATCH 2/2] nfs4: fix comments in discover_server_trunking Weston Andros Adamson
@ 2014-01-20 4:20 ` Weston Andros Adamson
0 siblings, 0 replies; 4+ messages in thread
From: Weston Andros Adamson @ 2014-01-20 4:20 UTC (permalink / raw)
To: Trond Myklebust; +Cc: linux-nfs list
Ignore this patch. I misunderstood the meaning of the original comments...
-dros
On Jan 19, 2014, at 10:45 PM, Weston Andros Adamson <dros@primarydata.com> wrote:
> 'result' is not updated if a match isn't found in the
> nfs4_discover_server_trunking path.
>
> Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
> ---
> fs/nfs/nfs4client.c | 4 ++--
> fs/nfs/nfs4state.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
> index 0f9b772..147a752 100644
> --- a/fs/nfs/nfs4client.c
> +++ b/fs/nfs/nfs4client.c
> @@ -465,7 +465,7 @@ static void nfs4_swap_callback_idents(struct nfs_client *keep,
> * nfs40_walk_client_list - Find server that recognizes a client ID
> *
> * @new: nfs_client with client ID to test
> - * @result: OUT: found nfs_client, or new
> + * @result: OUT: found nfs_client
> * @cred: credential to use for trunking test
> *
> * Returns zero, a negative errno, or a negative NFS4ERR status.
> @@ -601,7 +601,7 @@ out_major_mismatch:
> * nfs41_walk_client_list - Find nfs_client that matches a client/server owner
> *
> * @new: nfs_client with client ID to test
> - * @result: OUT: found nfs_client, or new
> + * @result: OUT: found nfs_client
> * @cred: credential to use for trunking test
> *
> * Returns zero, a negative errno, or a negative NFS4ERR status.
> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
> index e5be725..666512e 100644
> --- a/fs/nfs/nfs4state.c
> +++ b/fs/nfs/nfs4state.c
> @@ -328,7 +328,7 @@ out:
> * nfs41_discover_server_trunking - Detect server IP address trunking (mv1)
> *
> * @clp: nfs_client under test
> - * @result: OUT: found nfs_client, or clp
> + * @result: OUT: found nfs_client
> * @cred: credential to use for trunking test
> *
> * Returns NFS4_OK, a negative errno, or a negative NFS4ERR status.
> --
> 1.8.3.4 (Apple Git-47)
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] nfs4: fix discover_server_trunking use after free
[not found] <1390189537-9666-1-git-send-email-dros@primarydata.com>
2014-01-20 3:45 ` [PATCH 2/2] nfs4: fix comments in discover_server_trunking Weston Andros Adamson
@ 2014-01-20 23:32 ` Trond Myklebust
2014-01-21 15:04 ` Weston Andros Adamson
1 sibling, 1 reply; 4+ messages in thread
From: Trond Myklebust @ 2014-01-20 23:32 UTC (permalink / raw)
To: Adamson Weston Andros; +Cc: linux-nfs
On Jan 19, 2014, at 20:45, Weston Andros Adamson <dros@primarydata.com> wrote:
> If clp is new (cl_count = 1) and it matches another client in
> nfs4_discover_server_trunking, the nfs_put_client will free clp before
> ->cl_preserve_clid is set.
>
> Cc: stable@vger.kernel.org # 3.7+
> Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
> ---
> fs/nfs/nfs4client.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
> index c1b7a80..0f9b772 100644
> --- a/fs/nfs/nfs4client.c
> +++ b/fs/nfs/nfs4client.c
> @@ -414,11 +414,12 @@ struct nfs_client *nfs4_init_client(struct nfs_client *clp,
> error = nfs4_discover_server_trunking(clp, &old);
> if (error < 0)
> goto error;
> - nfs_put_client(clp);
> - if (clp != old) {
> +
> + if (clp != old)
> clp->cl_preserve_clid = true;
> + nfs_put_client(clp);
> + if (clp != old)
> clp = old;
> - }
>
Applied, but I cleaned it up by replacing the last 2 lines with an equivalent ‘return old’...
--
Trond Myklebust
Linux NFS client maintainer
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] nfs4: fix discover_server_trunking use after free
2014-01-20 23:32 ` [PATCH 1/2] nfs4: fix discover_server_trunking use after free Trond Myklebust
@ 2014-01-21 15:04 ` Weston Andros Adamson
0 siblings, 0 replies; 4+ messages in thread
From: Weston Andros Adamson @ 2014-01-21 15:04 UTC (permalink / raw)
To: Trond Myklebust; +Cc: linux-nfs list
On Jan 20, 2014, at 6:32 PM, Trond Myklebust <trond.myklebust@primarydata.com> wrote:
>
> On Jan 19, 2014, at 20:45, Weston Andros Adamson <dros@primarydata.com> wrote:
>
>> If clp is new (cl_count = 1) and it matches another client in
>> nfs4_discover_server_trunking, the nfs_put_client will free clp before
>> ->cl_preserve_clid is set.
>>
>> Cc: stable@vger.kernel.org # 3.7+
>> Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
>> ---
>> fs/nfs/nfs4client.c | 7 ++++---
>> 1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
>> index c1b7a80..0f9b772 100644
>> --- a/fs/nfs/nfs4client.c
>> +++ b/fs/nfs/nfs4client.c
>> @@ -414,11 +414,12 @@ struct nfs_client *nfs4_init_client(struct nfs_client *clp,
>> error = nfs4_discover_server_trunking(clp, &old);
>> if (error < 0)
>> goto error;
>> - nfs_put_client(clp);
>> - if (clp != old) {
>> +
>> + if (clp != old)
>> clp->cl_preserve_clid = true;
>> + nfs_put_client(clp);
>> + if (clp != old)
>> clp = old;
>> - }
>>
>
> Applied, but I cleaned it up by replacing the last 2 lines with an equivalent ‘return old’…
Cool, I almost posted that, but thought this change was a “cleaner” diff.
-dros
>
> --
> Trond Myklebust
> Linux NFS client maintainer
>
> --
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-01-21 15:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1390189537-9666-1-git-send-email-dros@primarydata.com>
2014-01-20 3:45 ` [PATCH 2/2] nfs4: fix comments in discover_server_trunking Weston Andros Adamson
2014-01-20 4:20 ` Weston Andros Adamson
2014-01-20 23:32 ` [PATCH 1/2] nfs4: fix discover_server_trunking use after free Trond Myklebust
2014-01-21 15:04 ` Weston Andros Adamson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox