Commit 5f38d46b authored by Tigran Mkrtchyan's avatar Tigran Mkrtchyan
Browse files

nfs4: minor version used by callback must by in sync with client

Motivation:
When server performs callback to a client it must use the same nfsv4
minor version as client uses.

Modification:
store client's minor version information with call-back object.

Result:
fixes compatibility with nfsv4.2 clients.

Acked-by: Albert Rossi
Acked-by: Lea Morschel
Acked-by: Paul Millar
Target: master, 0.21
parent 417048fd
/* /*
* Copyright (c) 2009 - 2018 Deutsches Elektronen-Synchroton, * Copyright (c) 2009 - 2020 Deutsches Elektronen-Synchroton,
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY * Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY
* *
* This library is free software; you can redistribute it and/or modify * This library is free software; you can redistribute it and/or modify
...@@ -78,6 +78,10 @@ public class ClientCB { ...@@ -78,6 +78,10 @@ public class ClientCB {
private static final int CB_VERSION = 1; private static final int CB_VERSION = 1;
private final sessionid4 _session; private final sessionid4 _session;
/**
* Minor version of the nfs protocol used by client.
*/
private final int _minorVersion;
/** /**
* authentication flavor to be used for call-backs * authentication flavor to be used for call-backs
*/ */
...@@ -100,13 +104,15 @@ public class ClientCB { ...@@ -100,13 +104,15 @@ public class ClientCB {
/** /**
* @param transport for call-back communication * @param transport for call-back communication
* @param minorVersion nfs4 protocol minor version used by client.
* @param session associated with the client * @param session associated with the client
* @param highestSlotId highest slot id to use * @param highestSlotId highest slot id to use
* @param program RPC program number to use * @param program RPC program number to use
* @param sec_parms supported security flavors * @param sec_parms supported security flavors
*/ */
ClientCB(RpcTransport transport, int program, sessionid4 session, int highestSlotId, ClientCB(RpcTransport transport, int program, int minorVersion, sessionid4 session, int highestSlotId,
callback_sec_parms4[] sec_parms) { callback_sec_parms4[] sec_parms) {
_minorVersion = minorVersion;
_session = session; _session = session;
switch (sec_parms[0].cb_secflavor) { switch (sec_parms[0].cb_secflavor) {
...@@ -157,7 +163,7 @@ public class ClientCB { ...@@ -157,7 +163,7 @@ public class ClientCB {
System.arraycopy(cbOperations, 0, cbCompound.argarray, 1, cbOperations.length); System.arraycopy(cbOperations, 0, cbCompound.argarray, 1, cbOperations.length);
cbCompound.minorversion = new uint32_t(1); cbCompound.minorversion = new uint32_t(_minorVersion);
cbCompound.callback_ident = new uint32_t(0); cbCompound.callback_ident = new uint32_t(0);
cbCompound.tag = new utf8str_cs(tag); cbCompound.tag = new utf8str_cs(tag);
......
/* /*
* Copyright (c) 2009 - 2017 Deutsches Elektronen-Synchroton, * Copyright (c) 2009 - 2020 Deutsches Elektronen-Synchroton,
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY * Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY
* *
* This library is free software; you can redistribute it and/or modify * This library is free software; you can redistribute it and/or modify
...@@ -118,6 +118,7 @@ public class OperationCREATE_SESSION extends AbstractNFSv4Operation { ...@@ -118,6 +118,7 @@ public class OperationCREATE_SESSION extends AbstractNFSv4Operation {
ClientCB cb = new ClientCB( ClientCB cb = new ClientCB(
context.getRpcCall().getTransport().getPeerTransport(), context.getRpcCall().getTransport().getPeerTransport(),
_args.opcreate_session.csa_cb_program.value, _args.opcreate_session.csa_cb_program.value,
context.getMinorversion(),
session.id(), session.id(),
_args.opcreate_session.csa_back_chan_attrs.ca_maxrequests.value, _args.opcreate_session.csa_back_chan_attrs.ca_maxrequests.value,
_args.opcreate_session.csa_sec_parms); _args.opcreate_session.csa_sec_parms);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment