162306a36Sopenharmony_ci=============================
262306a36Sopenharmony_ciNFSv4.1 Server Implementation
362306a36Sopenharmony_ci=============================
462306a36Sopenharmony_ci
562306a36Sopenharmony_ciServer support for minorversion 1 can be controlled using the
662306a36Sopenharmony_ci/proc/fs/nfsd/versions control file.  The string output returned
762306a36Sopenharmony_ciby reading this file will contain either "+4.1" or "-4.1"
862306a36Sopenharmony_cicorrespondingly.
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ciCurrently, server support for minorversion 1 is enabled by default.
1162306a36Sopenharmony_ciIt can be disabled at run time by writing the string "-4.1" to
1262306a36Sopenharmony_cithe /proc/fs/nfsd/versions control file.  Note that to write this
1362306a36Sopenharmony_cicontrol file, the nfsd service must be taken down.  You can use rpc.nfsd
1462306a36Sopenharmony_cifor this; see rpc.nfsd(8).
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci(Warning: older servers will interpret "+4.1" and "-4.1" as "+4" and
1762306a36Sopenharmony_ci"-4", respectively.  Therefore, code meant to work on both new and old
1862306a36Sopenharmony_cikernels must turn 4.1 on or off *before* turning support for version 4
1962306a36Sopenharmony_cion or off; rpc.nfsd does this correctly.)
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ciThe NFSv4 minorversion 1 (NFSv4.1) implementation in nfsd is based
2262306a36Sopenharmony_cion RFC 5661.
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ciFrom the many new features in NFSv4.1 the current implementation
2562306a36Sopenharmony_cifocuses on the mandatory-to-implement NFSv4.1 Sessions, providing
2662306a36Sopenharmony_ci"exactly once" semantics and better control and throttling of the
2762306a36Sopenharmony_ciresources allocated for each client.
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ciThe table below, taken from the NFSv4.1 document, lists
3062306a36Sopenharmony_cithe operations that are mandatory to implement (REQ), optional
3162306a36Sopenharmony_ci(OPT), and NFSv4.0 operations that are required not to implement (MNI)
3262306a36Sopenharmony_ciin minor version 1.  The first column indicates the operations that
3362306a36Sopenharmony_ciare not supported yet by the linux server implementation.
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ciThe OPTIONAL features identified and their abbreviations are as follows:
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci- **pNFS**	Parallel NFS
3862306a36Sopenharmony_ci- **FDELG**	File Delegations
3962306a36Sopenharmony_ci- **DDELG**	Directory Delegations
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ciThe following abbreviations indicate the linux server implementation status.
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci- **I**	Implemented NFSv4.1 operations.
4462306a36Sopenharmony_ci- **NS**	Not Supported.
4562306a36Sopenharmony_ci- **NS\***	Unimplemented optional feature.
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ciOperations
4862306a36Sopenharmony_ci==========
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
5162306a36Sopenharmony_ci| Implementation status | Operation            | REQ,REC, OPT or NMI | Feature (REQ, REC or OPT) | Definition     |
5262306a36Sopenharmony_ci+=======================+======================+=====================+===========================+================+
5362306a36Sopenharmony_ci|                       | ACCESS               | REQ                 |                           | Section 18.1   |
5462306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
5562306a36Sopenharmony_ci| I                     | BACKCHANNEL_CTL      | REQ                 |                           | Section 18.33  |
5662306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
5762306a36Sopenharmony_ci| I                     | BIND_CONN_TO_SESSION | REQ                 |                           | Section 18.34  |
5862306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
5962306a36Sopenharmony_ci|                       | CLOSE                | REQ                 |                           | Section 18.2   |
6062306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
6162306a36Sopenharmony_ci|                       | COMMIT               | REQ                 |                           | Section 18.3   |
6262306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
6362306a36Sopenharmony_ci|                       | CREATE               | REQ                 |                           | Section 18.4   |
6462306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
6562306a36Sopenharmony_ci| I                     | CREATE_SESSION       | REQ                 |                           | Section 18.36  |
6662306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
6762306a36Sopenharmony_ci| NS*                   | DELEGPURGE           | OPT                 | FDELG (REQ)               | Section 18.5   |
6862306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
6962306a36Sopenharmony_ci|                       | DELEGRETURN          | OPT                 | FDELG,                    | Section 18.6   |
7062306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
7162306a36Sopenharmony_ci|                       |                      |                     | DDELG, pNFS               |                |
7262306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
7362306a36Sopenharmony_ci|                       |                      |                     | (REQ)                     |                |
7462306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
7562306a36Sopenharmony_ci| I                     | DESTROY_CLIENTID     | REQ                 |                           | Section 18.50  |
7662306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
7762306a36Sopenharmony_ci| I                     | DESTROY_SESSION      | REQ                 |                           | Section 18.37  |
7862306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
7962306a36Sopenharmony_ci| I                     | EXCHANGE_ID          | REQ                 |                           | Section 18.35  |
8062306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
8162306a36Sopenharmony_ci| I                     | FREE_STATEID         | REQ                 |                           | Section 18.38  |
8262306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
8362306a36Sopenharmony_ci|                       | GETATTR              | REQ                 |                           | Section 18.7   |
8462306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
8562306a36Sopenharmony_ci| I                     | GETDEVICEINFO        | OPT                 | pNFS (REQ)                | Section 18.40  |
8662306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
8762306a36Sopenharmony_ci| NS*                   | GETDEVICELIST        | OPT                 | pNFS (OPT)                | Section 18.41  |
8862306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
8962306a36Sopenharmony_ci|                       | GETFH                | REQ                 |                           | Section 18.8   |
9062306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
9162306a36Sopenharmony_ci| NS*                   | GET_DIR_DELEGATION   | OPT                 | DDELG (REQ)               | Section 18.39  |
9262306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
9362306a36Sopenharmony_ci| I                     | LAYOUTCOMMIT         | OPT                 | pNFS (REQ)                | Section 18.42  |
9462306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
9562306a36Sopenharmony_ci| I                     | LAYOUTGET            | OPT                 | pNFS (REQ)                | Section 18.43  |
9662306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
9762306a36Sopenharmony_ci| I                     | LAYOUTRETURN         | OPT                 | pNFS (REQ)                | Section 18.44  |
9862306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
9962306a36Sopenharmony_ci|                       | LINK                 | OPT                 |                           | Section 18.9   |
10062306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
10162306a36Sopenharmony_ci|                       | LOCK                 | REQ                 |                           | Section 18.10  |
10262306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
10362306a36Sopenharmony_ci|                       | LOCKT                | REQ                 |                           | Section 18.11  |
10462306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
10562306a36Sopenharmony_ci|                       | LOCKU                | REQ                 |                           | Section 18.12  |
10662306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
10762306a36Sopenharmony_ci|                       | LOOKUP               | REQ                 |                           | Section 18.13  |
10862306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
10962306a36Sopenharmony_ci|                       | LOOKUPP              | REQ                 |                           | Section 18.14  |
11062306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
11162306a36Sopenharmony_ci|                       | NVERIFY              | REQ                 |                           | Section 18.15  |
11262306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
11362306a36Sopenharmony_ci|                       | OPEN                 | REQ                 |                           | Section 18.16  |
11462306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
11562306a36Sopenharmony_ci| NS*                   | OPENATTR             | OPT                 |                           | Section 18.17  |
11662306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
11762306a36Sopenharmony_ci|                       | OPEN_CONFIRM         | MNI                 |                           | N/A            |
11862306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
11962306a36Sopenharmony_ci|                       | OPEN_DOWNGRADE       | REQ                 |                           | Section 18.18  |
12062306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
12162306a36Sopenharmony_ci|                       | PUTFH                | REQ                 |                           | Section 18.19  |
12262306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
12362306a36Sopenharmony_ci|                       | PUTPUBFH             | REQ                 |                           | Section 18.20  |
12462306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
12562306a36Sopenharmony_ci|                       | PUTROOTFH            | REQ                 |                           | Section 18.21  |
12662306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
12762306a36Sopenharmony_ci|                       | READ                 | REQ                 |                           | Section 18.22  |
12862306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
12962306a36Sopenharmony_ci|                       | READDIR              | REQ                 |                           | Section 18.23  |
13062306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
13162306a36Sopenharmony_ci|                       | READLINK             | OPT                 |                           | Section 18.24  |
13262306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
13362306a36Sopenharmony_ci|                       | RECLAIM_COMPLETE     | REQ                 |                           | Section 18.51  |
13462306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
13562306a36Sopenharmony_ci|                       | RELEASE_LOCKOWNER    | MNI                 |                           | N/A            |
13662306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
13762306a36Sopenharmony_ci|                       | REMOVE               | REQ                 |                           | Section 18.25  |
13862306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
13962306a36Sopenharmony_ci|                       | RENAME               | REQ                 |                           | Section 18.26  |
14062306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
14162306a36Sopenharmony_ci|                       | RENEW                | MNI                 |                           | N/A            |
14262306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
14362306a36Sopenharmony_ci|                       | RESTOREFH            | REQ                 |                           | Section 18.27  |
14462306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
14562306a36Sopenharmony_ci|                       | SAVEFH               | REQ                 |                           | Section 18.28  |
14662306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
14762306a36Sopenharmony_ci|                       | SECINFO              | REQ                 |                           | Section 18.29  |
14862306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
14962306a36Sopenharmony_ci| I                     | SECINFO_NO_NAME      | REC                 | pNFS files                | Section 18.45, |
15062306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
15162306a36Sopenharmony_ci|                       |                      |                     | layout (REQ)              | Section 13.12  |
15262306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
15362306a36Sopenharmony_ci| I                     | SEQUENCE             | REQ                 |                           | Section 18.46  |
15462306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
15562306a36Sopenharmony_ci|                       | SETATTR              | REQ                 |                           | Section 18.30  |
15662306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
15762306a36Sopenharmony_ci|                       | SETCLIENTID          | MNI                 |                           | N/A            |
15862306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
15962306a36Sopenharmony_ci|                       | SETCLIENTID_CONFIRM  | MNI                 |                           | N/A            |
16062306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
16162306a36Sopenharmony_ci| NS                    | SET_SSV              | REQ                 |                           | Section 18.47  |
16262306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
16362306a36Sopenharmony_ci| I                     | TEST_STATEID         | REQ                 |                           | Section 18.48  |
16462306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
16562306a36Sopenharmony_ci|                       | VERIFY               | REQ                 |                           | Section 18.31  |
16662306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
16762306a36Sopenharmony_ci| NS*                   | WANT_DELEGATION      | OPT                 | FDELG (OPT)               | Section 18.49  |
16862306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
16962306a36Sopenharmony_ci|                       | WRITE                | REQ                 |                           | Section 18.32  |
17062306a36Sopenharmony_ci+-----------------------+----------------------+---------------------+---------------------------+----------------+
17162306a36Sopenharmony_ci
17262306a36Sopenharmony_ci
17362306a36Sopenharmony_ciCallback Operations
17462306a36Sopenharmony_ci===================
17562306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
17662306a36Sopenharmony_ci| Implementation status | Operation               | REQ,REC, OPT or NMI | Feature (REQ, REC or OPT) | Definition    |
17762306a36Sopenharmony_ci+=======================+=========================+=====================+===========================+===============+
17862306a36Sopenharmony_ci|                       | CB_GETATTR              | OPT                 | FDELG (REQ)               | Section 20.1  |
17962306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
18062306a36Sopenharmony_ci| I                     | CB_LAYOUTRECALL         | OPT                 | pNFS (REQ)                | Section 20.3  |
18162306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
18262306a36Sopenharmony_ci| NS*                   | CB_NOTIFY               | OPT                 | DDELG (REQ)               | Section 20.4  |
18362306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
18462306a36Sopenharmony_ci| NS*                   | CB_NOTIFY_DEVICEID      | OPT                 | pNFS (OPT)                | Section 20.12 |
18562306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
18662306a36Sopenharmony_ci| NS*                   | CB_NOTIFY_LOCK          | OPT                 |                           | Section 20.11 |
18762306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
18862306a36Sopenharmony_ci| NS*                   | CB_PUSH_DELEG           | OPT                 | FDELG (OPT)               | Section 20.5  |
18962306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
19062306a36Sopenharmony_ci|                       | CB_RECALL               | OPT                 | FDELG,                    | Section 20.2  |
19162306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
19262306a36Sopenharmony_ci|                       |                         |                     | DDELG, pNFS               |               |
19362306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
19462306a36Sopenharmony_ci|                       |                         |                     | (REQ)                     |               |
19562306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
19662306a36Sopenharmony_ci| NS*                   | CB_RECALL_ANY           | OPT                 | FDELG,                    | Section 20.6  |
19762306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
19862306a36Sopenharmony_ci|                       |                         |                     | DDELG, pNFS               |               |
19962306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
20062306a36Sopenharmony_ci|                       |                         |                     | (REQ)                     |               |
20162306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
20262306a36Sopenharmony_ci| NS                    | CB_RECALL_SLOT          | REQ                 |                           | Section 20.8  |
20362306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
20462306a36Sopenharmony_ci| NS*                   | CB_RECALLABLE_OBJ_AVAIL | OPT                 | DDELG, pNFS               | Section 20.7  |
20562306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
20662306a36Sopenharmony_ci|                       |                         |                     | (REQ)                     |               |
20762306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
20862306a36Sopenharmony_ci| I                     | CB_SEQUENCE             | OPT                 | FDELG,                    | Section 20.9  |
20962306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
21062306a36Sopenharmony_ci|                       |                         |                     | DDELG, pNFS               |               |
21162306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
21262306a36Sopenharmony_ci|                       |                         |                     | (REQ)                     |               |
21362306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
21462306a36Sopenharmony_ci| NS*                   | CB_WANTS_CANCELLED      | OPT                 | FDELG,                    | Section 20.10 |
21562306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
21662306a36Sopenharmony_ci|                       |                         |                     | DDELG, pNFS               |               |
21762306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
21862306a36Sopenharmony_ci|                       |                         |                     | (REQ)                     |               |
21962306a36Sopenharmony_ci+-----------------------+-------------------------+---------------------+---------------------------+---------------+
22062306a36Sopenharmony_ci
22162306a36Sopenharmony_ci
22262306a36Sopenharmony_ciImplementation notes:
22362306a36Sopenharmony_ci=====================
22462306a36Sopenharmony_ci
22562306a36Sopenharmony_ciSSV:
22662306a36Sopenharmony_ci  The spec claims this is mandatory, but we don't actually know of any
22762306a36Sopenharmony_ci  implementations, so we're ignoring it for now.  The server returns
22862306a36Sopenharmony_ci  NFS4ERR_ENCR_ALG_UNSUPP on EXCHANGE_ID, which should be future-proof.
22962306a36Sopenharmony_ci
23062306a36Sopenharmony_ciGSS on the backchannel:
23162306a36Sopenharmony_ci  Again, theoretically required but not widely implemented (in
23262306a36Sopenharmony_ci  particular, the current Linux client doesn't request it).  We return
23362306a36Sopenharmony_ci  NFS4ERR_ENCR_ALG_UNSUPP on CREATE_SESSION.
23462306a36Sopenharmony_ci
23562306a36Sopenharmony_ciDELEGPURGE:
23662306a36Sopenharmony_ci  mandatory only for servers that support CLAIM_DELEGATE_PREV and/or
23762306a36Sopenharmony_ci  CLAIM_DELEG_PREV_FH (which allows clients to keep delegations that
23862306a36Sopenharmony_ci  persist across client reboots).  Thus we need not implement this for
23962306a36Sopenharmony_ci  now.
24062306a36Sopenharmony_ci
24162306a36Sopenharmony_ciEXCHANGE_ID:
24262306a36Sopenharmony_ci  implementation ids are ignored
24362306a36Sopenharmony_ci
24462306a36Sopenharmony_ciCREATE_SESSION:
24562306a36Sopenharmony_ci  backchannel attributes are ignored
24662306a36Sopenharmony_ci
24762306a36Sopenharmony_ciSEQUENCE:
24862306a36Sopenharmony_ci  no support for dynamic slot table renegotiation (optional)
24962306a36Sopenharmony_ci
25062306a36Sopenharmony_ciNonstandard compound limitations:
25162306a36Sopenharmony_ci  No support for a sessions fore channel RPC compound that requires both a
25262306a36Sopenharmony_ci  ca_maxrequestsize request and a ca_maxresponsesize reply, so we may
25362306a36Sopenharmony_ci  fail to live up to the promise we made in CREATE_SESSION fore channel
25462306a36Sopenharmony_ci  negotiation.
25562306a36Sopenharmony_ci
25662306a36Sopenharmony_ciSee also http://wiki.linux-nfs.org/wiki/index.php/Server_4.0_and_4.1_issues.
257