Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 1 | NFSv4.1 Server Implementation |
| 2 | |
| 3 | Server support for minorversion 1 can be controlled using the |
| 4 | /proc/fs/nfsd/versions control file. The string output returned |
| 5 | by reading this file will contain either "+4.1" or "-4.1" |
| 6 | correspondingly. |
| 7 | |
J. Bruce Fields | 4bd8eab | 2013-11-19 09:50:48 -0500 | [diff] [blame] | 8 | Currently, server support for minorversion 1 is enabled by default. |
| 9 | It can be disabled at run time by writing the string "-4.1" to |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 10 | the /proc/fs/nfsd/versions control file. Note that to write this |
J. Bruce Fields | 4bd8eab | 2013-11-19 09:50:48 -0500 | [diff] [blame] | 11 | control file, the nfsd service must be taken down. You can use rpc.nfsd |
| 12 | for this; see rpc.nfsd(8). |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 13 | |
J. Bruce Fields | 285a0f0 | 2009-09-20 17:01:33 -0400 | [diff] [blame] | 14 | (Warning: older servers will interpret "+4.1" and "-4.1" as "+4" and |
| 15 | "-4", respectively. Therefore, code meant to work on both new and old |
| 16 | kernels must turn 4.1 on or off *before* turning support for version 4 |
| 17 | on or off; rpc.nfsd does this correctly.) |
| 18 | |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 19 | The NFSv4 minorversion 1 (NFSv4.1) implementation in nfsd is based |
J. Bruce Fields | 73834d6 | 2010-01-20 17:17:04 -0500 | [diff] [blame] | 20 | on RFC 5661. |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 21 | |
| 22 | From the many new features in NFSv4.1 the current implementation |
| 23 | focuses on the mandatory-to-implement NFSv4.1 Sessions, providing |
| 24 | "exactly once" semantics and better control and throttling of the |
| 25 | resources allocated for each client. |
| 26 | |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 27 | The table below, taken from the NFSv4.1 document, lists |
| 28 | the operations that are mandatory to implement (REQ), optional |
| 29 | (OPT), and NFSv4.0 operations that are required not to implement (MNI) |
| 30 | in minor version 1. The first column indicates the operations that |
| 31 | are not supported yet by the linux server implementation. |
| 32 | |
| 33 | The OPTIONAL features identified and their abbreviations are as follows: |
| 34 | pNFS Parallel NFS |
| 35 | FDELG File Delegations |
| 36 | DDELG Directory Delegations |
| 37 | |
| 38 | The following abbreviations indicate the linux server implementation status. |
| 39 | I Implemented NFSv4.1 operations. |
| 40 | NS Not Supported. |
Christoph Hellwig | 18d1aef | 2014-09-25 11:28:02 +0200 | [diff] [blame] | 41 | NS* Unimplemented optional feature. |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 42 | |
| 43 | Operations |
| 44 | |
| 45 | +----------------------+------------+--------------+----------------+ |
| 46 | | Operation | REQ, REC, | Feature | Definition | |
| 47 | | | OPT, or | (REQ, REC, | | |
| 48 | | | MNI | or OPT) | | |
| 49 | +----------------------+------------+--------------+----------------+ |
| 50 | | ACCESS | REQ | | Section 18.1 | |
J. Bruce Fields | cb73a9f | 2012-11-01 18:09:48 -0400 | [diff] [blame] | 51 | I | BACKCHANNEL_CTL | REQ | | Section 18.33 | |
J. Bruce Fields | c46556c | 2011-07-18 18:40:21 -0400 | [diff] [blame] | 52 | I | BIND_CONN_TO_SESSION | REQ | | Section 18.34 | |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 53 | | CLOSE | REQ | | Section 18.2 | |
| 54 | | COMMIT | REQ | | Section 18.3 | |
| 55 | | CREATE | REQ | | Section 18.4 | |
| 56 | I | CREATE_SESSION | REQ | | Section 18.36 | |
| 57 | NS*| DELEGPURGE | OPT | FDELG (REQ) | Section 18.5 | |
| 58 | | DELEGRETURN | OPT | FDELG, | Section 18.6 | |
| 59 | | | | DDELG, pNFS | | |
| 60 | | | | (REQ) | | |
J. Bruce Fields | 292a417 | 2012-11-07 19:41:51 -0500 | [diff] [blame] | 61 | I | DESTROY_CLIENTID | REQ | | Section 18.50 | |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 62 | I | DESTROY_SESSION | REQ | | Section 18.37 | |
| 63 | I | EXCHANGE_ID | REQ | | Section 18.35 | |
J. Bruce Fields | c46556c | 2011-07-18 18:40:21 -0400 | [diff] [blame] | 64 | I | FREE_STATEID | REQ | | Section 18.38 | |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 65 | | GETATTR | REQ | | Section 18.7 | |
Christoph Hellwig | 18d1aef | 2014-09-25 11:28:02 +0200 | [diff] [blame] | 66 | I | GETDEVICEINFO | OPT | pNFS (REQ) | Section 18.40 | |
| 67 | NS*| GETDEVICELIST | OPT | pNFS (OPT) | Section 18.41 | |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 68 | | GETFH | REQ | | Section 18.8 | |
| 69 | NS*| GET_DIR_DELEGATION | OPT | DDELG (REQ) | Section 18.39 | |
Christoph Hellwig | 18d1aef | 2014-09-25 11:28:02 +0200 | [diff] [blame] | 70 | I | LAYOUTCOMMIT | OPT | pNFS (REQ) | Section 18.42 | |
| 71 | I | LAYOUTGET | OPT | pNFS (REQ) | Section 18.43 | |
| 72 | I | LAYOUTRETURN | OPT | pNFS (REQ) | Section 18.44 | |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 73 | | LINK | OPT | | Section 18.9 | |
| 74 | | LOCK | REQ | | Section 18.10 | |
| 75 | | LOCKT | REQ | | Section 18.11 | |
| 76 | | LOCKU | REQ | | Section 18.12 | |
| 77 | | LOOKUP | REQ | | Section 18.13 | |
| 78 | | LOOKUPP | REQ | | Section 18.14 | |
| 79 | | NVERIFY | REQ | | Section 18.15 | |
| 80 | | OPEN | REQ | | Section 18.16 | |
| 81 | NS*| OPENATTR | OPT | | Section 18.17 | |
| 82 | | OPEN_CONFIRM | MNI | | N/A | |
| 83 | | OPEN_DOWNGRADE | REQ | | Section 18.18 | |
| 84 | | PUTFH | REQ | | Section 18.19 | |
| 85 | | PUTPUBFH | REQ | | Section 18.20 | |
| 86 | | PUTROOTFH | REQ | | Section 18.21 | |
| 87 | | READ | REQ | | Section 18.22 | |
| 88 | | READDIR | REQ | | Section 18.23 | |
| 89 | | READLINK | OPT | | Section 18.24 | |
J. Bruce Fields | 4dc6ec0 | 2010-04-19 15:11:28 -0400 | [diff] [blame] | 90 | | RECLAIM_COMPLETE | REQ | | Section 18.51 | |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 91 | | RELEASE_LOCKOWNER | MNI | | N/A | |
| 92 | | REMOVE | REQ | | Section 18.25 | |
| 93 | | RENAME | REQ | | Section 18.26 | |
| 94 | | RENEW | MNI | | N/A | |
| 95 | | RESTOREFH | REQ | | Section 18.27 | |
| 96 | | SAVEFH | REQ | | Section 18.28 | |
| 97 | | SECINFO | REQ | | Section 18.29 | |
J. Bruce Fields | c46556c | 2011-07-18 18:40:21 -0400 | [diff] [blame] | 98 | I | SECINFO_NO_NAME | REC | pNFS files | Section 18.45, | |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 99 | | | | layout (REQ) | Section 13.12 | |
| 100 | I | SEQUENCE | REQ | | Section 18.46 | |
| 101 | | SETATTR | REQ | | Section 18.30 | |
| 102 | | SETCLIENTID | MNI | | N/A | |
| 103 | | SETCLIENTID_CONFIRM | MNI | | N/A | |
| 104 | NS | SET_SSV | REQ | | Section 18.47 | |
J. Bruce Fields | c46556c | 2011-07-18 18:40:21 -0400 | [diff] [blame] | 105 | I | TEST_STATEID | REQ | | Section 18.48 | |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 106 | | VERIFY | REQ | | Section 18.31 | |
| 107 | NS*| WANT_DELEGATION | OPT | FDELG (OPT) | Section 18.49 | |
| 108 | | WRITE | REQ | | Section 18.32 | |
| 109 | |
| 110 | Callback Operations |
| 111 | |
| 112 | +-------------------------+-----------+-------------+---------------+ |
| 113 | | Operation | REQ, REC, | Feature | Definition | |
| 114 | | | OPT, or | (REQ, REC, | | |
| 115 | | | MNI | or OPT) | | |
| 116 | +-------------------------+-----------+-------------+---------------+ |
| 117 | | CB_GETATTR | OPT | FDELG (REQ) | Section 20.1 | |
Christoph Hellwig | 18d1aef | 2014-09-25 11:28:02 +0200 | [diff] [blame] | 118 | I | CB_LAYOUTRECALL | OPT | pNFS (REQ) | Section 20.3 | |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 119 | NS*| CB_NOTIFY | OPT | DDELG (REQ) | Section 20.4 | |
Christoph Hellwig | 18d1aef | 2014-09-25 11:28:02 +0200 | [diff] [blame] | 120 | NS*| CB_NOTIFY_DEVICEID | OPT | pNFS (OPT) | Section 20.12 | |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 121 | NS*| CB_NOTIFY_LOCK | OPT | | Section 20.11 | |
| 122 | NS*| CB_PUSH_DELEG | OPT | FDELG (OPT) | Section 20.5 | |
| 123 | | CB_RECALL | OPT | FDELG, | Section 20.2 | |
| 124 | | | | DDELG, pNFS | | |
| 125 | | | | (REQ) | | |
| 126 | NS*| CB_RECALL_ANY | OPT | FDELG, | Section 20.6 | |
| 127 | | | | DDELG, pNFS | | |
| 128 | | | | (REQ) | | |
| 129 | NS | CB_RECALL_SLOT | REQ | | Section 20.8 | |
| 130 | NS*| CB_RECALLABLE_OBJ_AVAIL | OPT | DDELG, pNFS | Section 20.7 | |
| 131 | | | | (REQ) | | |
| 132 | I | CB_SEQUENCE | OPT | FDELG, | Section 20.9 | |
| 133 | | | | DDELG, pNFS | | |
| 134 | | | | (REQ) | | |
| 135 | NS*| CB_WANTS_CANCELLED | OPT | FDELG, | Section 20.10 | |
| 136 | | | | DDELG, pNFS | | |
| 137 | | | | (REQ) | | |
| 138 | +-------------------------+-----------+-------------+---------------+ |
| 139 | |
| 140 | Implementation notes: |
| 141 | |
J. Bruce Fields | 4bd8eab | 2013-11-19 09:50:48 -0500 | [diff] [blame] | 142 | SSV: |
| 143 | * The spec claims this is mandatory, but we don't actually know of any |
| 144 | implementations, so we're ignoring it for now. The server returns |
| 145 | NFS4ERR_ENCR_ALG_UNSUPP on EXCHANGE_ID, which should be future-proof. |
| 146 | |
| 147 | GSS on the backchannel: |
| 148 | * Again, theoretically required but not widely implemented (in |
| 149 | particular, the current Linux client doesn't request it). We return |
| 150 | NFS4ERR_ENCR_ALG_UNSUPP on CREATE_SESSION. |
| 151 | |
J. Bruce Fields | 285a0f0 | 2009-09-20 17:01:33 -0400 | [diff] [blame] | 152 | DELEGPURGE: |
| 153 | * mandatory only for servers that support CLAIM_DELEGATE_PREV and/or |
| 154 | CLAIM_DELEG_PREV_FH (which allows clients to keep delegations that |
| 155 | persist across client reboots). Thus we need not implement this for |
| 156 | now. |
| 157 | |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 158 | EXCHANGE_ID: |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 159 | * implementation ids are ignored |
| 160 | |
| 161 | CREATE_SESSION: |
| 162 | * backchannel attributes are ignored |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 163 | |
| 164 | SEQUENCE: |
| 165 | * no support for dynamic slot table renegotiation (optional) |
| 166 | |
Andy Adamson | ddc04fd | 2009-09-23 21:32:21 -0400 | [diff] [blame] | 167 | Nonstandard compound limitations: |
| 168 | * No support for a sessions fore channel RPC compound that requires both a |
| 169 | ca_maxrequestsize request and a ca_maxresponsesize reply, so we may |
| 170 | fail to live up to the promise we made in CREATE_SESSION fore channel |
| 171 | negotiation. |
J. Bruce Fields | c46556c | 2011-07-18 18:40:21 -0400 | [diff] [blame] | 172 | |
| 173 | See also http://wiki.linux-nfs.org/wiki/index.php/Server_4.0_and_4.1_issues. |