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 | |
| 8 | Currently, server support for minorversion 1 is disabled by default. |
| 9 | It can be enabled at run time by writing the string "+4.1" to |
| 10 | the /proc/fs/nfsd/versions control file. Note that to write this |
| 11 | control file, the nfsd service must be taken down. Use your user-mode |
| 12 | nfs-utils to set this up; see rpc.nfsd(8) |
| 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 |
| 20 | on the latest NFSv4.1 Internet Draft: |
| 21 | http://tools.ietf.org/html/draft-ietf-nfsv4-minorversion1-29 |
| 22 | |
| 23 | From the many new features in NFSv4.1 the current implementation |
| 24 | focuses on the mandatory-to-implement NFSv4.1 Sessions, providing |
| 25 | "exactly once" semantics and better control and throttling of the |
| 26 | resources allocated for each client. |
| 27 | |
| 28 | Other NFSv4.1 features, Parallel NFS operations in particular, |
| 29 | are still under development out of tree. |
| 30 | See http://wiki.linux-nfs.org/wiki/index.php/PNFS_prototype_design |
| 31 | for more information. |
| 32 | |
J. Bruce Fields | 285a0f0 | 2009-09-20 17:01:33 -0400 | [diff] [blame] | 33 | The current implementation is intended for developers only: while it |
| 34 | does support ordinary file operations on clients we have tested against |
| 35 | (including the linux client), it is incomplete in ways which may limit |
| 36 | features unexpectedly, cause known bugs in rare cases, or cause |
| 37 | interoperability problems with future clients. Known issues: |
| 38 | |
| 39 | - gss support is questionable: currently mounts with kerberos |
| 40 | from a linux client are possible, but we aren't really |
| 41 | conformant with the spec (for example, we don't use kerberos |
| 42 | on the backchannel correctly). |
| 43 | - no trunking support: no clients currently take advantage of |
| 44 | trunking, but this is a mandatory failure, and its use is |
| 45 | recommended to clients in a number of places. (E.g. to ensure |
| 46 | timely renewal in case an existing connection's retry timeouts |
| 47 | have gotten too long; see section 8.3 of the draft.) |
| 48 | Therefore, lack of this feature may cause future clients to |
| 49 | fail. |
| 50 | - Incomplete backchannel support: incomplete backchannel gss |
| 51 | support and no support for BACKCHANNEL_CTL mean that |
| 52 | callbacks (hence delegations and layouts) may not be |
| 53 | available and clients confused by the incomplete |
| 54 | implementation may fail. |
| 55 | - Server reboot recovery is unsupported; if the server reboots, |
| 56 | clients may fail. |
| 57 | - We do not support SSV, which provides security for shared |
| 58 | client-server state (thus preventing unauthorized tampering |
| 59 | with locks and opens, for example). It is mandatory for |
| 60 | servers to support this, though no clients use it yet. |
| 61 | - Mandatory operations which we do not support, such as |
| 62 | DESTROY_CLIENTID, FREE_STATEID, SECINFO_NO_NAME, and |
| 63 | TEST_STATEID, are not currently used by clients, but will be |
| 64 | (and the spec recommends their uses in common cases), and |
| 65 | clients should not be expected to know how to recover from the |
| 66 | case where they are not supported. This will eventually cause |
| 67 | interoperability failures. |
| 68 | |
| 69 | In addition, some limitations are inherited from the current NFSv4 |
| 70 | implementation: |
| 71 | |
| 72 | - Incomplete delegation enforcement: if a file is renamed or |
| 73 | unlinked, a client holding a delegation may continue to |
| 74 | indefinitely allow opens of the file under the old name. |
| 75 | |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 76 | The table below, taken from the NFSv4.1 document, lists |
| 77 | the operations that are mandatory to implement (REQ), optional |
| 78 | (OPT), and NFSv4.0 operations that are required not to implement (MNI) |
| 79 | in minor version 1. The first column indicates the operations that |
| 80 | are not supported yet by the linux server implementation. |
| 81 | |
| 82 | The OPTIONAL features identified and their abbreviations are as follows: |
| 83 | pNFS Parallel NFS |
| 84 | FDELG File Delegations |
| 85 | DDELG Directory Delegations |
| 86 | |
| 87 | The following abbreviations indicate the linux server implementation status. |
| 88 | I Implemented NFSv4.1 operations. |
| 89 | NS Not Supported. |
| 90 | NS* unimplemented optional feature. |
| 91 | P pNFS features implemented out of tree. |
| 92 | PNS pNFS features that are not supported yet (out of tree). |
| 93 | |
| 94 | Operations |
| 95 | |
| 96 | +----------------------+------------+--------------+----------------+ |
| 97 | | Operation | REQ, REC, | Feature | Definition | |
| 98 | | | OPT, or | (REQ, REC, | | |
| 99 | | | MNI | or OPT) | | |
| 100 | +----------------------+------------+--------------+----------------+ |
| 101 | | ACCESS | REQ | | Section 18.1 | |
| 102 | NS | BACKCHANNEL_CTL | REQ | | Section 18.33 | |
| 103 | NS | BIND_CONN_TO_SESSION | REQ | | Section 18.34 | |
| 104 | | CLOSE | REQ | | Section 18.2 | |
| 105 | | COMMIT | REQ | | Section 18.3 | |
| 106 | | CREATE | REQ | | Section 18.4 | |
| 107 | I | CREATE_SESSION | REQ | | Section 18.36 | |
| 108 | NS*| DELEGPURGE | OPT | FDELG (REQ) | Section 18.5 | |
| 109 | | DELEGRETURN | OPT | FDELG, | Section 18.6 | |
| 110 | | | | DDELG, pNFS | | |
| 111 | | | | (REQ) | | |
| 112 | NS | DESTROY_CLIENTID | REQ | | Section 18.50 | |
| 113 | I | DESTROY_SESSION | REQ | | Section 18.37 | |
| 114 | I | EXCHANGE_ID | REQ | | Section 18.35 | |
| 115 | NS | FREE_STATEID | REQ | | Section 18.38 | |
| 116 | | GETATTR | REQ | | Section 18.7 | |
| 117 | P | GETDEVICEINFO | OPT | pNFS (REQ) | Section 18.40 | |
| 118 | P | GETDEVICELIST | OPT | pNFS (OPT) | Section 18.41 | |
| 119 | | GETFH | REQ | | Section 18.8 | |
| 120 | NS*| GET_DIR_DELEGATION | OPT | DDELG (REQ) | Section 18.39 | |
| 121 | P | LAYOUTCOMMIT | OPT | pNFS (REQ) | Section 18.42 | |
| 122 | P | LAYOUTGET | OPT | pNFS (REQ) | Section 18.43 | |
| 123 | P | LAYOUTRETURN | OPT | pNFS (REQ) | Section 18.44 | |
| 124 | | LINK | OPT | | Section 18.9 | |
| 125 | | LOCK | REQ | | Section 18.10 | |
| 126 | | LOCKT | REQ | | Section 18.11 | |
| 127 | | LOCKU | REQ | | Section 18.12 | |
| 128 | | LOOKUP | REQ | | Section 18.13 | |
| 129 | | LOOKUPP | REQ | | Section 18.14 | |
| 130 | | NVERIFY | REQ | | Section 18.15 | |
| 131 | | OPEN | REQ | | Section 18.16 | |
| 132 | NS*| OPENATTR | OPT | | Section 18.17 | |
| 133 | | OPEN_CONFIRM | MNI | | N/A | |
| 134 | | OPEN_DOWNGRADE | REQ | | Section 18.18 | |
| 135 | | PUTFH | REQ | | Section 18.19 | |
| 136 | | PUTPUBFH | REQ | | Section 18.20 | |
| 137 | | PUTROOTFH | REQ | | Section 18.21 | |
| 138 | | READ | REQ | | Section 18.22 | |
| 139 | | READDIR | REQ | | Section 18.23 | |
| 140 | | READLINK | OPT | | Section 18.24 | |
| 141 | NS | RECLAIM_COMPLETE | REQ | | Section 18.51 | |
| 142 | | RELEASE_LOCKOWNER | MNI | | N/A | |
| 143 | | REMOVE | REQ | | Section 18.25 | |
| 144 | | RENAME | REQ | | Section 18.26 | |
| 145 | | RENEW | MNI | | N/A | |
| 146 | | RESTOREFH | REQ | | Section 18.27 | |
| 147 | | SAVEFH | REQ | | Section 18.28 | |
| 148 | | SECINFO | REQ | | Section 18.29 | |
| 149 | NS | SECINFO_NO_NAME | REC | pNFS files | Section 18.45, | |
| 150 | | | | layout (REQ) | Section 13.12 | |
| 151 | I | SEQUENCE | REQ | | Section 18.46 | |
| 152 | | SETATTR | REQ | | Section 18.30 | |
| 153 | | SETCLIENTID | MNI | | N/A | |
| 154 | | SETCLIENTID_CONFIRM | MNI | | N/A | |
| 155 | NS | SET_SSV | REQ | | Section 18.47 | |
| 156 | NS | TEST_STATEID | REQ | | Section 18.48 | |
| 157 | | VERIFY | REQ | | Section 18.31 | |
| 158 | NS*| WANT_DELEGATION | OPT | FDELG (OPT) | Section 18.49 | |
| 159 | | WRITE | REQ | | Section 18.32 | |
| 160 | |
| 161 | Callback Operations |
| 162 | |
| 163 | +-------------------------+-----------+-------------+---------------+ |
| 164 | | Operation | REQ, REC, | Feature | Definition | |
| 165 | | | OPT, or | (REQ, REC, | | |
| 166 | | | MNI | or OPT) | | |
| 167 | +-------------------------+-----------+-------------+---------------+ |
| 168 | | CB_GETATTR | OPT | FDELG (REQ) | Section 20.1 | |
| 169 | P | CB_LAYOUTRECALL | OPT | pNFS (REQ) | Section 20.3 | |
| 170 | NS*| CB_NOTIFY | OPT | DDELG (REQ) | Section 20.4 | |
| 171 | P | CB_NOTIFY_DEVICEID | OPT | pNFS (OPT) | Section 20.12 | |
| 172 | NS*| CB_NOTIFY_LOCK | OPT | | Section 20.11 | |
| 173 | NS*| CB_PUSH_DELEG | OPT | FDELG (OPT) | Section 20.5 | |
| 174 | | CB_RECALL | OPT | FDELG, | Section 20.2 | |
| 175 | | | | DDELG, pNFS | | |
| 176 | | | | (REQ) | | |
| 177 | NS*| CB_RECALL_ANY | OPT | FDELG, | Section 20.6 | |
| 178 | | | | DDELG, pNFS | | |
| 179 | | | | (REQ) | | |
| 180 | NS | CB_RECALL_SLOT | REQ | | Section 20.8 | |
| 181 | NS*| CB_RECALLABLE_OBJ_AVAIL | OPT | DDELG, pNFS | Section 20.7 | |
| 182 | | | | (REQ) | | |
| 183 | I | CB_SEQUENCE | OPT | FDELG, | Section 20.9 | |
| 184 | | | | DDELG, pNFS | | |
| 185 | | | | (REQ) | | |
| 186 | NS*| CB_WANTS_CANCELLED | OPT | FDELG, | Section 20.10 | |
| 187 | | | | DDELG, pNFS | | |
| 188 | | | | (REQ) | | |
| 189 | +-------------------------+-----------+-------------+---------------+ |
| 190 | |
| 191 | Implementation notes: |
| 192 | |
J. Bruce Fields | 285a0f0 | 2009-09-20 17:01:33 -0400 | [diff] [blame] | 193 | DELEGPURGE: |
| 194 | * mandatory only for servers that support CLAIM_DELEGATE_PREV and/or |
| 195 | CLAIM_DELEG_PREV_FH (which allows clients to keep delegations that |
| 196 | persist across client reboots). Thus we need not implement this for |
| 197 | now. |
| 198 | |
Benny Halevy | 3ef1728 | 2009-04-03 08:29:20 +0300 | [diff] [blame] | 199 | EXCHANGE_ID: |
| 200 | * only SP4_NONE state protection supported |
| 201 | * implementation ids are ignored |
| 202 | |
| 203 | CREATE_SESSION: |
| 204 | * backchannel attributes are ignored |
| 205 | * backchannel security parameters are ignored |
| 206 | |
| 207 | SEQUENCE: |
| 208 | * no support for dynamic slot table renegotiation (optional) |
| 209 | |
| 210 | nfsv4.1 COMPOUND rules: |
| 211 | The following cases aren't supported yet: |
| 212 | * Enforcing of NFS4ERR_NOT_ONLY_OP for: BIND_CONN_TO_SESSION, CREATE_SESSION, |
| 213 | DESTROY_CLIENTID, DESTROY_SESSION, EXCHANGE_ID. |
| 214 | * DESTROY_SESSION MUST be the final operation in the COMPOUND request. |
| 215 | |