2015-02-09 16:57:55

by Mkrtchyan, Tigran

[permalink] [raw]
Subject: [PATCH] nfs: do not initialize back channel with DS

Signed-off-by: Tigran Mkrtchyan <[email protected]>
---
fs/nfs/nfs4proc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 2e7c9f7..7f9674d 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -7236,9 +7236,12 @@ static int _nfs4_proc_create_session(struct nfs_client *clp,
.rpc_cred = cred,
};
int status;
+ int flags = SESSION4_PERSIST;

nfs4_init_channel_attrs(&args);
- args.flags = (SESSION4_PERSIST | SESSION4_BACK_CHAN);
+ if (!is_ds_only_client(clp))
+ flags |= SESSION4_BACK_CHAN;
+ args.flags = flags;

status = rpc_call_sync(session->clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT);
trace_nfs4_create_session(clp, status);
--
2.1.0



2015-02-09 17:38:37

by Trond Myklebust

[permalink] [raw]
Subject: Re: [PATCH] nfs: do not initialize back channel with DS

Hi Tigran,

On Mon, Feb 9, 2015 at 11:57 AM, Tigran Mkrtchyan
<[email protected]> wrote:
> Signed-off-by: Tigran Mkrtchyan <[email protected]>
> ---
> fs/nfs/nfs4proc.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index 2e7c9f7..7f9674d 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -7236,9 +7236,12 @@ static int _nfs4_proc_create_session(struct nfs_client *clp,
> .rpc_cred = cred,
> };
> int status;
> + int flags = SESSION4_PERSIST;
>
> nfs4_init_channel_attrs(&args);
> - args.flags = (SESSION4_PERSIST | SESSION4_BACK_CHAN);
> + if (!is_ds_only_client(clp))
> + flags |= SESSION4_BACK_CHAN;
> + args.flags = flags;
>
> status = rpc_call_sync(session->clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT);
> trace_nfs4_create_session(clp, status);

Why is this useful? If the server doesn't want to create a back
channel, then it just clears that flag in the csr_flags field in the
reply.

Cheers
Trond
--
Trond Myklebust
Linux NFS client maintainer, PrimaryData
[email protected]

2015-02-09 18:37:24

by Mkrtchyan, Tigran

[permalink] [raw]
Subject: Re: [PATCH] nfs: do not initialize back channel with DS



----- Original Message -----
> From: "Trond Myklebust" <[email protected]>
> To: "Tigran Mkrtchyan" <[email protected]>
> Cc: "Linux NFS Mailing List" <[email protected]>
> Sent: Monday, February 9, 2015 6:38:35 PM
> Subject: Re: [PATCH] nfs: do not initialize back channel with DS

> Hi Tigran,
>

Hi Trond,

> On Mon, Feb 9, 2015 at 11:57 AM, Tigran Mkrtchyan
> <[email protected]> wrote:
>> Signed-off-by: Tigran Mkrtchyan <[email protected]>
>> ---
>> fs/nfs/nfs4proc.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
>> index 2e7c9f7..7f9674d 100644
>> --- a/fs/nfs/nfs4proc.c
>> +++ b/fs/nfs/nfs4proc.c
>> @@ -7236,9 +7236,12 @@ static int _nfs4_proc_create_session(struct nfs_client
>> *clp,
>> .rpc_cred = cred,
>> };
>> int status;
>> + int flags = SESSION4_PERSIST;
>>
>> nfs4_init_channel_attrs(&args);
>> - args.flags = (SESSION4_PERSIST | SESSION4_BACK_CHAN);
>> + if (!is_ds_only_client(clp))
>> + flags |= SESSION4_BACK_CHAN;
>> + args.flags = flags;
>>
>> status = rpc_call_sync(session->clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT);
>> trace_nfs4_create_session(clp, status);
>
> Why is this useful? If the server doesn't want to create a back
> channel, then it just clears that flag in the csr_flags field in the
> reply.

You are right, there is no much benefit on the server side. The assumption was
that client allocates some resources (request queue, reply cache) associated with
the back channel.

If it's not the case, then just ignore this change.

Tigran.

>
> Cheers
> Trond
> --
> Trond Myklebust
> Linux NFS client maintainer, PrimaryData
> [email protected]
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html