As per Relevance of the word procedure, we have this rfc below:
Network Working Group B.
Request for Comments: 1813 B.
Category: Informational P.
Sun Microsystems, Inc
June 1995
NFS Version 3 Protocol
Status of this
This memo provides information for the Internet community
This memo does not specify an Internet standard of any kind
Distribution of this memo is unlimited
IESG
Internet Engineering Steering Group comment: please note
the IETF is not involved in creating or maintaining
specification. This is the significance of the
not being on the standards track
This paper describes the NFS version 3 protocol. This paper
provided so that people can write compatible implementations
Table of
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . 3
1.1 Scope of the NFS version 3 protocol . . . . . . . . . . 4
1.2 Useful terms . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Remote Procedure Call . . . . . . . . . . . . . . . . . 5
1.4 External Data Representation . . . . . . . . . . . . . . 5
1.5 Authentication and Permission Checking . . . . . . . . . 7
1.6 Philosophy . . . . . . . . . . . . . . . . . . . . . . . 8
1.7 Changes from the NFS version 2 protocol . . . . . . . . 11
2. RPC Information . . . . . . . . . . . . . . . . . . . . . 14
2.1 Authentication . . . . . . . . . . . . . . . . . . . . . 14
2.2 Constants . . . . . . . . . . . . . . . . . . . . . . . 14
2.3 Transport address . . . . . . . . . . . . . . . . . . . 14
2.4 Sizes . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.5 Basic Data Types . . . . . . . . . . . . . . . . . . . . 15
2.6 Defined Error Numbers . . . . . . . . . . . . . . . . . 17
3. Server Procedures . . . . . . . . . . . . . . . . . . . . 27
3.1 General comments on attributes . . . . . . . . . . . . . 29
3.2 General comments on filenames . . . . . . . . . . . . . 30
3.3.0 NULL: Do nothing . . . . . . . . . . . . . . . . . . . . 31
Callaghan, el al Informational [Page 1]
RFC 1813 NFS Version 3 Protocol June 1995
3.3.1 GETATTR: Get file attributes . . . . . . . . . . . . . . 32
3.3.2 SETATTR: Set file attributes . . . . . . . . . . . . . . 33
3.3.3 LOOKUP: Lookup filename . . . . . . . . . . . . . . . . 37
3.3.4 ACCESS: Check access permission . . . . . . . . . . . . 40
3.3.5 READLINK: Read from symbolic link . . . . . . . . . . . 44
3.3.6 READ: Read from file . . . . . . . . . . . . . . . . . . 46
3.3.7 WRITE: Write to file . . . . . . . . . . . . . . . . . . 49
3.3.8 CREATE: Create a file . . . . . . . . . . . . . . . . . 54
3.3.9 MKDIR: Create a directory . . . . . . . . . . . . . . . 58
3.3.10 SYMLINK: Create a symbolic link . . . . . . . . . . . . 61
3.3.11 MKNOD: Create a special device . . . . . . . . . . . . . 63
3.3.12 REMOVE: Remove a file . . . . . . . . . . . . . . . . . 67
3.3.13 RMDIR: Remove a directory . . . . . . . . . . . . . . . 69
3.3.14 RENAME: Rename a file or directory . . . . . . . . . . . 71
3.3.15 LINK: Create link to an object . . . . . . . . . . . . . 74
3.3.16 READDIR: Read From directory . . . . . . . . . . . . . . 76
3.3.17 READDIRPLUS: Extended read from directory . . . . . . . 80
3.3.18 FSSTAT: Get dynamic file system information . . . . . . 84
3.3.19 FSINFO: Get static file system information . . . . . . . 86
3.3.20 PATHCONF: Retrieve POSIX information . . . . . . . . . . 90
3.3.21 COMMIT: Commit cached data on a server to stable storage 92
4. Implementation issues . . . . . . . . . . . . . . . . . . 96
4.1 Multiple version support . . . . . . . . . . . . . . . . 96
4.2 Server/client relationship . . . . . . . . . . . . . . . 96
4.3 Path name interpretation . . . . . . . . . . . . . . . . 97
4.4 Permission issues . . . . . . . . . . . . . . . . . . . 98
4.5 Duplicate request cache . . . . . . . . . . . . . . . . 99
4.6 File name component handling . . . . . . . . . . . . . . 101
4.7 Synchronous modifying operations . . . . . . . . . . . . 101
4.8 Stable storage . . . . . . . . . . . . . . . . . . . . . 101
4.9 Lookups and name resolution . . . . . . . . . . . . . . 102
4.10 Adaptive retransmission . . . . . . . . . . . . . . . . 102
4.11 Caching policies . . . . . . . . . . . . . . . . . . . . 102
4.12 Stable versus unstable writes. . . . . . . . . . . . . . 103
4.13 32 bit clients/servers and 64 bit clients/servers. . . . 104
5. Appendix I: Mount protocol . . . . . . . . . . . . . . . . 106
5.1 RPC Information . . . . . . . . . . . . . . . . . . . . 106
5.1.1 Authentication . . . . . . . . . . . . . . . . . . . . 106
5.1.2 Constants . . . . . . . . . . . . . . . . . . . . . . 106
5.1.3 Transport address . . . . . . . . . . . . . . . . . . 106
5.1.4 Sizes . . . . . . . . . . . . . . . . . . . . . . . . 106
5.1.5 Basic Data Types . . . . . . . . . . . . . . . . . . . 106
5.2 Server Procedures . . . . . . . . . . . . . . . . . . . 107
5.2.0 NULL: Do nothing . . . . . . . . . . . . . . . . . . . 108
5.2.1 MNT: Add mount entry . . . . . . . . . . . . . . . . . 109
5.2.2 DUMP: Return mount entries . . . . . . . . . . . . . . 110
5.2.3 UMNT: Remove mount entry . . . . . . . . . . . . . . . 111
5.2.4 UMNTALL: Remove all mount entries . . . . . . . . . . 112
Callaghan, el al Informational [Page 2]
RFC 1813 NFS Version 3 Protocol June 1995
5.2.5 EXPORT: Return export list . . . . . . . . . . . . . . 113
6. Appendix II: Lock manager protocol . . . . . . . . . . . . 114
6.1 RPC Information . . . . . . . . . . . . . . . . . . . . 114
6.1.1 Authentication . . . . . . . . . . . . . . . . . . . . 114
6.1.2 Constants . . . . . . . . . . . . . . . . . . . . . . 114
6.1.3 Transport Address . . . . . . . . . . . . . . . . . . 115
6.1.4 Basic Data Types . . . . . . . . . . . . . . . . . . . 115
6.2 NLM Procedures . . . . . . . . . . . . . . . . . . . . . 118
6.2.0 NULL: Do nothing . . . . . . . . . . . . . . . . . . . 120
6.3 Implementation issues . . . . . . . . . . . . . . . . . 120
6.3.1 64-bit offsets and lengths . . . . . . . . . . . . . . 120
6.3.2 File handles . . . . . . . . . . . . . . . . . . . . . 120
7. Appendix III: Bibliography . . . . . . . . . . . . . . . . 122
8. Security Considerations . . . . . . . . . . . . . . . . . 125
9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . 125
10. Authors' Addresses . . . . . . . . . . . . . . . . . . . . 126
1.
Sun's NFS protocol provides transparent remote access to
file systems across networks. The NFS protocol is designed to
machine, operating system, network architecture, and
protocol independent. This independence is achieved through
use of Remote Procedure Call (RPC) primitives built on top of
eXternal Data Representation (XDR). Implementations of the
version 2 protocol exist for a variety of machines, from
computers to supercomputers. The initial version of the
protocol is specified in the Network File System
Specification [RFC1094]. A description of the
implementation can be found in [Sandberg].
The supporting MOUNT protocol performs the
system-specific functions that allow clients to attach
directory trees to a point within the local file system.
mount process also allows the server to grant remote
privileges to a restricted set of clients via export control
The Lock Manager provides support for file locking when used
the NFS environment. The Network Lock Manager (NLM)
isolates the inherently stateful aspects of file locking into
separate protocol
A complete description of the above protocols and
implementation is to be found in [X/OpenNFS].
The purpose of this document is to
Callaghan, el al Informational [Page 3]
RFC 1813 NFS Version 3 Protocol June 1995
o Specify the NFS version 3 protocol
o Describe semantics of the protocol through
and description of intended implementation
o Specify the MOUNT version 3 protocol
o Briefly describe the changes between the NLM version 3
protocol and the NLM version 4 protocol
The normative text is the description of the RPC procedures
arguments and results, which defines the over-the-wire protocol
and the semantics of those procedures. The material
implementation practice aids the understanding of the
specification and describes some possible implementation
and solutions. It is not possible to describe all
and the UNIX operating system implementation of the NFS version 3
protocol is most often used to provide examples. Given that,
implementation discussion does not bear the authority of
description of the over-the-wire protocol itself
1.1 Scope of the NFS version 3
This revision of the NFS protocol addresses new requirements
The need to support larger files and file systems has
extensions to allow 64 bit file sizes and offsets. The
enhances security by adding support for an access check to
done on the server. Performance modifications are of
types
1. The number of over-the-wire packets for a
set of file operations is reduced by returning
attributes on every operation, thus decreasing the
of calls to get modified attributes
2. The write throughput bottleneck caused by the
definition of write in the NFS version 2 protocol has
addressed by adding support so that the NFS server can
unsafe writes. Unsafe writes are writes which have
been committed to stable storage before the
returns. This specification defines a method
committing these unsafe writes to stable storage in
reliable way
3. Limitations on transfer sizes have been relaxed
The ability to support multiple versions of a protocol in
will allow implementors of the NFS version 3 protocol to
Callaghan, el al Informational [Page 4]
RFC 1813 NFS Version 3 Protocol June 1995
clients and servers that provide backwards compatibility
the existing installed base of NFS version 2
implementations
The extensions described here represent an evolution of
existing NFS protocol and most of the design features of
NFS protocol described in [Sandberg] persist. See
from the NFS version 2 protocol on page 11 for a
detailed summary of the changes introduced by this revision
1.2 Useful
In this specification, a "server" is a machine that
resources to the network; a "client" is a machine that
resources over the network; a "user" is a person logged in on
client; an "application" is a program that executes on a client
1.3 Remote Procedure
The Sun Remote Procedure Call specification provides
procedure-oriented interface to remote services. Each
supplies a program, which is a set of procedures. The
service is one such program. The combination of host address
program number, version number, and procedure number specify
remote service procedure. Servers can support multiple
of a program by using different protocol version numbers
The NFS protocol was designed to not require any specific
of reliability from its lower levels so it could potentially
used on many underlying transport protocols. The NFS service
based on RPC which provides the abstraction above lower
network and transport protocols
The rest of this document assumes the NFS environment
implemented on top of Sun RPC, which is specified in [RFC1057].
A complete discussion is found in [Corbin].
1.4 External Data
The eXternal Data Representation (XDR) specification provides
standard way of representing a set of data types on a network
This solves the problem of different byte orders,
alignment, and data type representation on different
communicating machines
In this document, the RPC Data Description Language is used
specify the XDR format parameters and results to each of the
service procedures that an NFS server provides. The RPC
Callaghan, el al Informational [Page 5]
RFC 1813 NFS Version 3 Protocol June 1995
Description Language is similar to declarations in the
programming language. A few new constructs have been added
The notation
string name[SIZE];
string data;
defines name, which is a fixed size block of SIZE bytes,
data, which is a variable sized block of up to DSIZE bytes.
notation indicates fixed-length arrays and arrays with
variable number of elements up to a fixed maximum.
variable-length definition with no size specified means there
no maximum size for the field
The discriminated union definition
union example switch (enum status) {
case OK
struct {
filename file1;
filename file2;
integer count
}
case ERROR
struct {
errstat error
integer errno
}
default
void
}
defines a structure where the first thing over the network is
enumeration type called status. If the value of status is OK
the next thing on the network will be the structure
file1, file2, and count. Else, if the value of status is ERROR
the next thing on the network will be a structure
error and errno. If the value of status is neither OK
ERROR, then there is no more data in the structure
The XDR type, hyper, is an 8 byte (64 bit) quantity. It is
in the same way as the integer type. For example
hyper foo
unsigned hyper bar
foo is an 8 byte signed value, while bar is an 8 byte
value
Callaghan, el al Informational [Page 6]
RFC 1813 NFS Version 3 Protocol June 1995
Although RPC/XDR compilers exist to generate client and
stubs from RPC Data Description Language input,
implementations do not require their use. Any software
provides equivalent encoding and decoding to the
network order of data defined by XDR can be used to
with other NFS implementations
XDR is described in [RFC1014].
1.5 Authentication and Permission
The RPC protocol includes a slot for authentication
on every call. The contents of the authentication parameters
determined by the type of authentication used by the server
client. A server may support several different flavors
authentication at once. The AUTH_NONE flavor provides
authentication, that is, no authentication information
passed. The AUTH_UNIX flavor provides UNIX-style user ID,
ID, and groups with each call. The AUTH_DES flavor
DES-encrypted authentication parameters based on a network-
name, with session keys exchanged via a public key scheme.
AUTH_KERB flavor provides DES encrypted
parameters based on a network-wide name with session
exchanged via Kerberos secret keys
The NFS server checks permissions by taking the credentials
the RPC authentication information in each remote request.
example, using the AUTH_UNIX flavor of authentication,
server gets the user's effective user ID, effective group ID
groups on each call, and uses them to check access. Using
ids and group ids implies that the client and server
share the same ID list or do local user and group ID mapping
Servers and clients must agree on the mapping from user to
and from group to gid, for those sites that do not implement
consistent user ID and group ID space. In practice, such
is typically performed on the server, following a static
scheme or a mapping established by the user from a client
mount time
The AUTH_DES and AUTH_KERB style of authentication is based on
network-wide name. It provides greater security through the
of DES encryption and public keys in the case of AUTH_DES,
DES encryption and Kerberos secret keys (and tickets) in
AUTH_KERB case. Again, the server and client must agree on
identity of a particular name on the network, but the name
identity mapping is more operating system independent than
uid and gid mapping in AUTH_UNIX. Also, because
authentication parameters are encrypted, a malicious user
Callaghan, el al Informational [Page 7]
RFC 1813 NFS Version 3 Protocol June 1995
know another users network password or private key to
as that user. Similarly, the server returns a verifier that
also encrypted so that masquerading as a server requires
a network password
The NULL procedure typically requires no authentication
1.6
This specification defines the NFS version 3 protocol, that
the over-the-wire protocol by which a client accesses a server
The protocol provides a well-defined interface to a server'
file resources. A client or server implements the protocol
provides a mapping of the local file system semantics
actions into those defined in the NFS version 3 protocol
Implementations may differ to varying degrees, depending on
extent to which a given environment can support all
operations and semantics defined in the NFS version 3 protocol
Although implementations exist and are used to
various aspects of the NFS version 3 protocol, the
specification itself is the final description of how
access server resources
Because the NFS version 3 protocol is designed to
operating-system independent, it does not necessarily match
semantics of any existing system. Server implementations
expected to make a best effort at supporting the protocol. If
server cannot support a particular protocol procedure, it
return the error, NFS3ERR_NOTSUP, that indicates that
operation is not supported. For example, many operating
do not support the notion of a hard link. A server that
support hard links should return NFS3ERR_NOTSUP in response to
LINK request. FSINFO describes the most commonly
procedures in the properties bit map. Alternatively, a
may not natively support a given operation, but can emulate
in the NFS version 3 protocol implementation to provide
functionality
In some cases, a server can support most of the
described by the protocol but not all. For example, the
field in the fattr structure gives the time that a file'
attributes were last modified. Many systems do not keep
information. In this case, rather than not support the
operation, a server could simulate it by returning the
modified time in place of ctime. Servers must be careful
simulating attribute information because of possible
effects on clients. For example, many clients use
modification times as a basis for their cache
Callaghan, el al Informational [Page 8]
RFC 1813 NFS Version 3 Protocol June 1995
scheme
NFS servers are dumb and NFS clients are smart. It is
clients that do the work required to convert the
file access that servers provide into a file access method
is useful to applications and users. In the LINK example
above, a UNIX client that received an NFS3ERR_NOTSUP error
a server would do the recovery necessary to either make it
to the application like the link request had succeeded or
a reasonable error. In general, it is the burden of the
to recover
The NFS version 3 protocol assumes a stateless
implementation. Statelessness means that the server does
need to maintain state about any of its clients in order
function correctly. Stateless servers have a distinct
over stateful servers in the event of a crash. With
servers, a client need only retry a request until the
responds; the client does not even need to know that the
has crashed. See additional comments in Duplicate request
on page 99.
For a server to be useful, it holds nonvolatile state:
stored in the file system. Design assumptions in the NFS
3 protocol regarding flushing of modified data to stable
reduce the number of failure modes in which data loss can occur
In this way, NFS version 3 protocol implementations can
transient failures, including transient failures of the network
In general, server implementations of the NFS version 3
cannot tolerate a non-transient failure of the stable
itself. However, there exist fault tolerant
which attempt to address such problems
That is not to say that an NFS version 3 protocol server can'
maintain noncritical state. In many cases, servers will
state (cache) about previous operations to increase performance
For example, a client READ request might trigger a read-ahead
the next block of the file into the server's data cache in
anticipation that the client is doing a sequential read and
next client READ request will be satisfied from the server'
data cache instead of from the disk. Read-ahead on the
increases performance by overlapping server disk I/O with
requests. The important point here is that the read-ahead
is not necessary for correct server behavior. If the
crashes and loses its memory cache of read buffers, recovery
simple on reboot - clients will continue read
retrieving data from the server disk
Callaghan, el al Informational [Page 9]
RFC 1813 NFS Version 3 Protocol June 1995
Most data-modifying operations in the NFS protocol
synchronous. That is, when a data modifying procedure
to the client, the client can assume that the operation
completed and any modified data associated with the request
now on stable storage. For example, a synchronous client
request may cause the server to update data blocks, file
information blocks, and file attribute information - the
information is usually referred to as metadata. When the
operation completes, the client can assume that the write
is safe and discard it. This is a very important part of
stateless nature of the server. If the server did not
dirty data to stable storage before returning to the client,
client would have no way of knowing when it was safe to
modified data. The following data modifying procedures
synchronous: WRITE (with stable flag set to FILE_SYNC), CREATE
MKDIR, SYMLINK, MKNOD, REMOVE, RMDIR, RENAME, LINK, and COMMIT
The NFS version 3 protocol introduces safe asynchronous
on the server, when the WRITE procedure is used in
with the COMMIT procedure. The COMMIT procedure provides a
for the client to flush data from previous asynchronous
requests on the server to stable storage and to detect
it is necessary to retransmit the data. See the
descriptions of WRITE on page 49 and COMMIT on page 92.
The LOOKUP procedure is used by the client to
multicomponent file names (pathnames). Each call to LOOKUP
used to resolve one segment of a pathname. There are two
for restricting LOOKUP to a single segment: it is hard
standardize a common format for hierarchical file names and
client and server may have different mappings of pathnames
file systems. This would imply that either the client must
the path name at file system attachment points, or the
must know about the client's file system attachment points.
NFS version 3 protocol implementations, it is the client
constructs the hierarchical file name space using mounts
build a hierarchy. Support utilities, such as the Automounter
provide a way to manage a shared, consistent image of the
name space while still being driven by the client
process
Clients can perform caching in varied manner. The
practice with the NFS version 2 protocol was to implement
time-based client-server cache consistency mechanism. It
expected NFS version 3 protocol implementations will use
similar mechanism. The NFS version 3 protocol has some
support, in the form of additional attribute information
eliminate explicit attribute checks. However, caching is
Callaghan, el al Informational [Page 10]
RFC 1813 NFS Version 3 Protocol June 1995
required, nor is any caching policy defined by the protocol
Neither the NFS version 2 protocol nor the NFS version 3
protocol provide a means of maintaining strict client-
consistency (and, by implication, consistency across
caches).
1.7 Changes from the NFS Version 2
The ROOT and WRITECACHE procedures have been removed. A
procedure has been defined to allow the creation of
files, eliminating the overloading of CREATE. Caching on
client is not defined nor dictated by the NFS version 3
protocol, but additional information and hints have been
to the protocol to allow clients that implement caching
manage their caches more effectively. Procedures that affect
attributes of a file or directory may now return the
attributes after the operation has completed to optimize out
subsequent GETATTR used in validating attribute caches.
addition, operations that modify the directory in which
target object resides return the old and new attributes of
directory to allow clients to implement more intelligent
invalidation procedures. The ACCESS procedure provides
permission checking on the server, the FSSTAT procedure
dynamic information about a file system, the FSINFO
returns static information about a file system and server,
READDIRPLUS procedure returns file handles and attributes
addition to directory entries, and the PATHCONF
returns POSIX pathconf information about a file
Below is a list of the important changes between the NFS
2 protocol and the NFS version 3 protocol
File handle
The file handle has been increased to a variable-
array of 64 bytes maximum from a fixed array of 32
bytes. This addresses some known requirements for
slightly larger file handle size. The file handle
converted from fixed length to variable length
reduce local storage and network bandwidth
for systems which do not utilize the full 64 bytes
length
Maximum data
The maximum size of a data transfer used in the
and WRITE procedures is now set by values in the
return structure. In addition, preferred transfer
are returned by FSINFO. The protocol does not place
artificial limits on the maximum transfer sizes
Callaghan, el al Informational [Page 11]
RFC 1813 NFS Version 3 Protocol June 1995
Filenames and pathnames are now specified as strings
variable length. The actual length restrictions
determined by the client and server implementations
appropriate. The protocol does not place
artificial limits on the length. The error
NFS3ERR_NAMETOOLONG, is provided to allow the server
return an indication to the client that it received
pathname that was too long for it to handle
Error
Error returns in some instances now return data (
example, attributes). nfsstat3 now defines the full
of errors that can be returned by a server. No
values are allowed
File
The file type now includes NF3CHR and NF3BLK
special files. Attributes for these types
subfields for UNIX major and minor devices numbers
NF3SOCK and NF3FIFO are now defined for sockets
fifos in the file system
File
The blocksize (the size in bytes of a block in
file) field has been removed. The mode field no
contains file type information. The size and
fields have been widened to eight-byte
integers from four-byte integers. Major and
device information is now presented in a
structure. The blocks field name has been changed
used and now contains the total number of bytes used
the file. It is also an eight-byte unsigned integer
Set file
In the NFS version 2 protocol, the settable
were represented by a subset of the file
structure; the client indicated those attributes
were not to be modified by setting the
field to -1, overloading some unsigned fields. The
file attributes structure now uses a
union for each field to tell whether or how to set
field. The atime and mtime fields can be set to
the server's current time or a time supplied by
client
The LOOKUP return structure now includes the
for the directory searched
Callaghan, el al Informational [Page 12]
RFC 1813 NFS Version 3 Protocol June 1995
An ACCESS procedure has been added to allow an
over-the-wire permissions check. This addresses
problems with the superuser ID mapping feature in
server implementations (where, due to mapping of
user, unexpected permission denied errors could
while reading from or writing to a file). This
removes the assumption which was made in the
version 2 protocol that access to files was
solely on UNIX style mode bits
The reply structure includes a Boolean that is TRUE
the end-of-file was encountered during the READ.
allows the client to correctly detect end-of-file
The beginoffset and totalcount fields were removed
the WRITE arguments. The reply now includes a count
that the server can write less than the
amount of data, if required. An indicator was added
the arguments to instruct the server as to the level
cache synchronization that is required by the client
An exclusive flag and a create verifier was added
the exclusive creation of regular files
This procedure was added to support the creation
special files. This avoids overloading fields of
as was done in some NFS version 2
implementations
The READDIR arguments now include a verifier to
the server to validate the cookie. The cookie is now
64 bit unsigned integer instead of the 4 byte
which was used in the NFS version 2 protocol.
will help to reduce interoperability problems
This procedure was added to return file handles
attributes in an extended directory list
FSINFO was added to provide nonvolatile
about a file system. The reply includes preferred
Callaghan, el al Informational [Page 13]
RFC 1813 NFS Version 3 Protocol June 1995
maximum read transfer size, preferred and maximum
transfer size, and flags stating whether links
symbolic links are supported. Also returned
preferred transfer size for READDIR procedure replies
server time granularity, and whether times can be
in a SETATTR request
FSSTAT was added to provide volatile information
a file system, for use by utilities such as the
system df command. The reply includes the total
and free space in the file system specified in bytes
the total number of files and number of free file
in the file system, and an estimate of time
file system modifications (for use in cache
checking algorithms).
The COMMIT procedure provides the
mechanism to be used with asynchronous
operations
2. RPC
2.1
The NFS service uses AUTH_NONE in the NULL procedure. AUTH_UNIX
AUTH_DES, or AUTH_KERB are used for all other procedures.
authentication types may be supported in the future
2.2
These are the RPC constants needed to call the NFS Version 3
service. They are given in decimal
PROGRAM 100003
VERSION 3
2.3 Transport
The NFS protocol is normally supported over the TCP and
protocols. It uses port 2049, the same as the NFS version 2
protocol
2.4
These are the sizes, given in decimal bytes, of various
structures used in the NFS version 3 protocol
Callaghan, el al Informational [Page 14]
RFC 1813 NFS Version 3 Protocol June 1995
NFS3_FHSIZE 64
The maximum size in bytes of the opaque file handle
NFS3_COOKIEVERFSIZE 8
The size in bytes of the opaque cookie verifier passed
READDIR and READDIRPLUS
NFS3_CREATEVERFSIZE 8
The size in bytes of the opaque verifier used
exclusive CREATE
NFS3_WRITEVERFSIZE 8
The size in bytes of the opaque verifier used
asynchronous WRITE
2.5 Basic Data
The following XDR definitions are basic definitions that
used in other structures
uint64
typedef unsigned hyper uint64;
int64
typedef hyper int64;
uint32
typedef unsigned long uint32;
int32
typedef long int32;
filename
typedef string filename3<>;
nfspath
typedef string nfspath3<>;
fileid
typedef uint64 fileid3;
cookie
typedef uint64 cookie3;
cookieverf
typedef opaque cookieverf3[NFS3_COOKIEVERFSIZE];
Callaghan, el al Informational [Page 15]
RFC 1813 NFS Version 3 Protocol June 1995
createverf
typedef opaque createverf3[NFS3_CREATEVERFSIZE];
writeverf
typedef opaque writeverf3[NFS3_WRITEVERFSIZE];
uid
typedef uint32 uid3;
gid
typedef uint32 gid3;
size
typedef uint64 size3;
offset
typedef uint64 offset3;
mode
typedef uint32 mode3;
count
typedef uint32 count3;
nfsstat
enum nfsstat3 {
NFS3_OK = 0,
NFS3ERR_PERM = 1,
NFS3ERR_NOENT = 2,
NFS3ERR_IO = 5,
NFS3ERR_NXIO = 6,
NFS3ERR_ACCES = 13,
NFS3ERR_EXIST = 17,
NFS3ERR_XDEV = 18,
NFS3ERR_NODEV = 19,
NFS3ERR_NOTDIR = 20,
NFS3ERR_ISDIR = 21,
NFS3ERR_INVAL = 22,
NFS3ERR_FBIG = 27,
NFS3ERR_NOSPC = 28,
NFS3ERR_ROFS = 30,
NFS3ERR_MLINK = 31,
NFS3ERR_NAMETOOLONG = 63,
NFS3ERR_NOTEMPTY = 66,
NFS3ERR_DQUOT = 69,
NFS3ERR_STALE = 70,
NFS3ERR_REMOTE = 71,
NFS3ERR_BADHANDLE = 10001,
Callaghan, el al Informational [Page 16]
RFC 1813 NFS Version 3 Protocol June 1995
NFS3ERR_NOT_SYNC = 10002,
NFS3ERR_BAD_COOKIE = 10003,
NFS3ERR_NOTSUPP = 10004,
NFS3ERR_TOOSMALL = 10005,
NFS3ERR_SERVERFAULT = 10006,
NFS3ERR_BADTYPE = 10007,
NFS3ERR_JUKEBOX = 10008
};
The nfsstat3 type is returned with every procedure's
except for the NULL procedure. A value of NFS3_OK indicates
the call completed successfully. Any other value indicates
some error occurred on the call, as identified by the
code. Note that the precise numeric encoding must be followed
No other values may be returned by a server. Servers
expected to make a best effort mapping of error conditions
the set of error codes defined. In addition, no
precedences are specified by this specification.
precedences determine the error value that should be
when more than one error applies in a given situation. The
precedence will be determined by the individual
implementation. If the client requires specific
precedences, it should check for the specific errors
itself
2.6 Defined Error
A description of each defined error follows
NFS3_
Indicates the call completed successfully
NFS3ERR_
Not owner. The operation was not allowed because
caller is either not a privileged user (root) or not
owner of the target of the operation
NFS3ERR_
No such file or directory. The file or directory
specified does not exist
NFS3ERR_
I/O error. A hard error (for example, a disk error
occurred while processing the requested operation
NFS3ERR_
I/O error. No such device or address
Callaghan, el al Informational [Page 17]
RFC 1813 NFS Version 3 Protocol June 1995
NFS3ERR_
Permission denied. The caller does not have the
permission to perform the requested operation.
this with NFS3ERR_PERM, which restricts itself to
or privileged user permission failures
NFS3ERR_
File exists. The file specified already exists
NFS3ERR_
Attempt to do a cross-device hard link
NFS3ERR_
No such device
NFS3ERR_
Not a directory. The caller specified a non-directory
a directory operation
NFS3ERR_
Is a directory. The caller specified a directory in
non-directory operation
NFS3ERR_
Invalid argument or unsupported argument for
operation. Two examples are attempting a READLINK on
object other than a symbolic link or attempting
SETATTR a time field on a server that does not
this operation
NFS3ERR_
File too large. The operation would have caused a file
grow beyond the server's limit
NFS3ERR_
No space left on device. The operation would have
the server's file system to exceed its limit
NFS3ERR_
Read-only file system. A modifying operation
attempted on a read-only file system
NFS3ERR_
Too many hard links
NFS3ERR_
The filename in an operation was too long
Callaghan, el al Informational [Page 18]
RFC 1813 NFS Version 3 Protocol June 1995
NFS3ERR_
An attempt was made to remove a directory that was
empty
NFS3ERR_
Resource (quota) hard limit exceeded. The user's
limit on the server has been exceeded
NFS3ERR_
Invalid file handle. The file handle given in
arguments was invalid. The file referred to by that
handle no longer exists or access to it has
revoked
NFS3ERR_
Too many levels of remote in path. The file handle
in the arguments referred to a file on a non-local
system on the server
NFS3ERR_
Illegal NFS file handle. The file handle failed
consistency checks
NFS3ERR_NOT_
Update synchronization mismatch was detected during
SETATTR operation
NFS3ERR_BAD_
READDIR or READDIRPLUS cookie is stale
NFS3ERR_
Operation is not supported
NFS3ERR_
Buffer or request is too small
NFS3ERR_
An error occurred on the server which does not map to
of the legal NFS version 3 protocol error values.
client should translate this into an appropriate error
UNIX clients may choose to translate this to EIO
NFS3ERR_
An attempt was made to create an object of a type
supported by the server
Callaghan, el al Informational [Page 19]
RFC 1813 NFS Version 3 Protocol June 1995
NFS3ERR_
The server initiated the request, but was not able
complete it in a timely fashion. The client should
and then try the request with a new RPC transaction ID
For example, this error should be returned from a
that supports hierarchical storage and receives a
to process a file that has been migrated. In this case
the server should start the immigration process
respond to client with this error
ftype
enum ftype3 {
NF3REG = 1,
NF3DIR = 2,
NF3BLK = 3,
NF3CHR = 4,
NF3LNK = 5,
NF3SOCK = 6,
NF3FIFO = 7
};
The enumeration, ftype3, gives the type of a file. The type
NF3REG, is a regular file, NF3DIR is a directory, NF3BLK is
block special device file, NF3CHR is a character special
file, NF3LNK is a symbolic link, NF3SOCK is a socket,
NF3FIFO is a named pipe. Note that the precise enum
must be followed
specdata
struct specdata3 {
uint32 specdata1;
uint32 specdata2;
};
The interpretation of the two words depends on the type of
system object. For a block special (NF3BLK) or character
(NF3CHR) file, specdata1 and specdata2 are the major and
device numbers, respectively. (This is obviously
UNIX-specific interpretation.) For all other file types,
two elements should either be set to 0 or the values should
agreed upon by the client and server. If the client and
do not agree upon the values, the client should treat
fields as if they are set to 0. This data field is returned
part of the fattr3 structure and so is available from
replies returning attributes. Since these fields are
unused for objects which are not devices, out of
Callaghan, el al Informational [Page 20]
RFC 1813 NFS Version 3 Protocol June 1995
information can be passed from the server to the client
However, once again, both the server and the client must
on the values passed
nfs_fh
struct nfs_fh3 {
opaque data;
};
The nfs_fh3 is the variable-length opaque object returned by
server on LOOKUP, CREATE, SYMLINK, MKNOD, LINK, or
operations, which is used by the client on subsequent
to reference the file. The file handle contains all
information the server needs to distinguish an individual file
To the client, the file handle is opaque. The client stores
handles for use in a later request and can compare two
handles from the same server for equality by doing
byte-by-byte comparison, but cannot otherwise interpret
contents of file handles. If two file handles from the
server are equal, they must refer to the same file, but if
are not equal, no conclusions can be drawn. Servers should
to maintain a one-to-one correspondence between file handles
files, but this is not required. Clients should use file
comparisons only to improve performance, not for
behavior
Servers can revoke the access provided by a file handle at
time. If the file handle passed in a call refers to a
system object that no longer exists on the server or access
that file handle has been revoked, the error, NFS3ERR_STALE
should be returned
nfstime
struct nfstime3 {
uint32 seconds
uint32 nseconds
};
The nfstime3 structure gives the number of seconds
nanoseconds since midnight January 1, 1970 Greenwich Mean Time
It is used to pass time and date information. The
associated with files are all server times except in the case
a SETATTR operation where the client can explicitly set the
time. A server converts to and from local time when
time values, preserving as much accuracy as possible. If
precision of timestamps stored for a file is less than
Callaghan, el al Informational [Page 21]
RFC 1813 NFS Version 3 Protocol June 1995
defined by NFS version 3 protocol, loss of precision can occur
An adjunct time maintenance protocol is recommended to
client and server time skew
fattr
struct fattr3 {
ftype3 type
mode3 mode
uint32 nlink
uid3 uid
gid3 gid
size3 size
size3 used
specdata3 rdev
uint64 fsid
fileid3 fileid
nfstime3 atime
nfstime3 mtime
nfstime3 ctime
};
This structure defines the attributes of a file system object
It is returned by most operations on an object; in the case
operations that affect two objects (for example, a MKDIR
modifies the target directory attributes and defines
attributes for the newly created directory), the attributes
both may be returned. In some cases, the attributes are
in the structure, wcc_data, which is defined below; in
cases the attributes are returned alone. The main changes
the NFS version 2 protocol are that many of the fields have
widened and the major/minor device information is now
in a distinct structure rather than being packed into a word
The fattr3 structure contains the basic attributes of a file
All servers should support this set of attributes even if
have to simulate some of the fields. Type is the type of
file. Mode is the protection mode bits. Nlink is the number
hard links to the file - that is, the number of different
for the same file. Uid is the user ID of the owner of the file
Gid is the group ID of the group of the file. Size is the
of the file in bytes. Used is the number of bytes of disk
that the file actually uses (which can be smaller than the
because the file may have holes or it may be larger due
fragmentation). Rdev describes the device file if the file
is NF3CHR or NF3BLK - see specdata3 on page 20. Fsid is the
system identifier for the file system. Fileid is a number
uniquely identifies the file within its file system (on
Callaghan, el al Informational [Page 22]
RFC 1813 NFS Version 3 Protocol June 1995
this would be the inumber). Atime is the time when the file
was last accessed. Mtime is the time when the file data was
modified. Ctime is the time when the attributes of the
were last changed. Writing to the file changes the ctime
addition to the mtime
The mode bits are defined as follows
0x00800 Set user ID on execution
0x00400 Set group ID on execution
0x00200 Save swapped text (not defined in POSIX).
0x00100 Read permission for owner
0x00080 Write permission for owner
0x00040 Execute permission for owner on a file. Or
(search) permission for owner in directory
0x00020 Read permission for group
0x00010 Write permission for group
0x00008 Execute permission for group on a file. Or
(search) permission for group in directory
0x00004 Read permission for others
0x00002 Write permission for others
0x00001 Execute permission for others on a file. Or
(search) permission for others in directory
post_op_
union post_op_attr switch (bool attributes_follow) {
case TRUE
fattr3 attributes
case FALSE
void
};
This structure is used for returning attributes in
operations that are not directly involved with
attributes. One of the principles of this revision of the
protocol is to return the real value from the
operation and not an error from an incidental operation.
post_op_attr structure was designed to allow the server
recover from errors encountered while getting attributes
This appears to make returning attributes optional. However
server implementors are strongly encouraged to make best
to return attributes whenever possible, even when returning
error
Callaghan, el al Informational [Page 23]
RFC 1813 NFS Version 3 Protocol June 1995
wcc_
struct wcc_attr {
size3 size
nfstime3 mtime
nfstime3 ctime
};
This is the subset of pre-operation attributes needed to
support the weak cache consistency semantics. Size is the
size in bytes of the object before the operation. Mtime is
time of last modification of the object before the operation
Ctime is the time of last change to the attributes of the
before the operation. See discussion in wcc_attr on page 24.
The use of mtime by clients to detect changes to file
objects residing on a server is dependent on the granularity
the time base on the server
pre_op_
union pre_op_attr switch (bool attributes_follow) {
case TRUE
wcc_attr attributes
case FALSE
void
};
wcc_
struct wcc_data {
pre_op_attr before
post_op_attr after
};
When a client performs an operation that modifies the state of
file or directory on the server, it cannot immediately
from the post-operation attributes whether the operation
performed was the only operation on the object since the
time the client received the attributes for the object. This
important, since if an intervening operation has changed
object, the client will need to invalidate any cached data
the object (except for the data that it just wrote).
To deal with this, the notion of weak cache consistency data
wcc_data is introduced. A wcc_data structure consists of
key fields from the object attributes before the operation
together with the object attributes after the operation.
Callaghan, el al Informational [Page 24]
RFC 1813 NFS Version 3 Protocol June 1995
information allows the client to manage its cache
accurately than in NFS version 2 protocol implementations.
term, weak cache consistency, emphasizes the fact that
mechanism does not provide the strict server-client
that a cache consistency protocol would provide
In order to support the weak cache consistency model, the
will need to be able to get the pre-operation attributes of
object, perform the intended modify operation, and then get
post-operation attributes atomically. If there is a window
the object to get modified between the operation and either
the get attributes operations, then the client will not be
to determine whether it was the only entity to modify
object. Some information will have been lost, thus weakening
weak cache consistency guarantees
post_op_fh
union post_op_fh3 switch (bool handle_follows) {
case TRUE
nfs_fh3 handle
case FALSE
void
};
One of the principles of this revision of the NFS protocol is
return the real value from the indicated operation and not
error from an incidental operation. The post_op_fh3
was designed to allow the server to recover from
encountered while constructing a file handle
This is the structure used to return a file handle from
CREATE, MKDIR, SYMLINK, MKNOD, and READDIRPLUS requests. In
case, the client can get the file handle by issuing a
request after a successful return from one of the
operations. Returning the file handle is an optimization so
the client is not forced to immediately issue a LOOKUP
to get the file handle
sattr
enum time_how {
DONT_CHANGE = 0,
SET_TO_SERVER_TIME = 1,
SET_TO_CLIENT_TIME = 2
};
union set_mode3 switch (bool set_it) {
Callaghan, el al Informational [Page 25]
RFC 1813 NFS Version 3 Protocol June 1995
case TRUE
mode3 mode
default
void
};
union set_uid3 switch (bool set_it) {
case TRUE
uid3 uid
default
void
};
union set_gid3 switch (bool set_it) {
case TRUE
gid3 gid
default
void
};
union set_size3 switch (bool set_it) {
case TRUE
size3 size
default
void
};
union set_atime switch (time_how set_it) {
case SET_TO_CLIENT_TIME
nfstime3 atime
default
void
};
union set_mtime switch (time_how set_it) {
case SET_TO_CLIENT_TIME
nfstime3 mtime
default
void
};
struct sattr3 {
set_mode3 mode
set_uid3 uid
set_gid3 gid
set_size3 size
set_atime atime
set_mtime mtime
Callaghan, el al Informational [Page 26]
RFC 1813 NFS Version 3 Protocol June 1995
};
The sattr3 structure contains the file attributes that can
set from the client. The fields are the same as the
named fields in the fattr3 structure. In the NFS version 3
protocol, the settable attributes are described by a
containing a set of discriminated unions. Each union
whether the corresponding attribute is to be updated, and if so
how
There are two forms of discriminated unions used. In setting
mode, uid, gid, or size, the discriminated union is switched
a boolean, set_it; if it is TRUE, a value of the
type is then encoded
In setting the atime or mtime, the union is switched on
enumeration type, set_it. If set_it has the value DONT_CHANGE
the corresponding attribute is unchanged. If it has the value
SET_TO_SERVER_TIME, the corresponding attribute is set by
server to its local time; no data is provided by the client
Finally, if set_it has the value, SET_TO_CLIENT_TIME,
attribute is set to the time passed by the client in an nfstime
structure. (See FSINFO on page 86, which addresses the issue
time granularity).
diropargs
struct diropargs3 {
nfs_fh3 dir
filename3 name
};
The diropargs3 structure is used in directory operations.
file handle, dir, identifies the directory in which
manipulate or access the file, name. See additional comments
File name component handling on page 101.
3. Server
The following sections define the RPC procedures that
supplied by an NFS version 3 protocol server. The
procedure number is given at the top of the page with
name. The SYNOPSIS provides the name of the procedure,
list of the names of the arguments, the list of the names
the results, followed by the XDR argument declarations
results declarations. The information in the SYNOPSIS
specified in RPC Data Description Language as defined
[RFC1014]. The DESCRIPTION section tells what the
Callaghan, el al Informational [Page 27]
RFC 1813 NFS Version 3 Protocol June 1995
is expected to do and how its arguments and results are used
The ERRORS section lists the errors returned for
types of failures. These lists are not intended to be
definitive statement of all of the errors which can
returned by any specific procedure, but as a guide for
more common errors which may be returned.
implementations should be prepared to deal with
errors coming from a server. The IMPLEMENTATION field
information about how the procedure is expected to work
how it should be used by clients
program NFS_PROGRAM {
version NFS_V3 {
NFSPROC3_NULL(void) = 0;
GETATTR3
NFSPROC3_GETATTR(GETATTR3args) = 1;
SETATTR3
NFSPROC3_SETATTR(SETATTR3args) = 2;
LOOKUP3
NFSPROC3_LOOKUP(LOOKUP3args) = 3;
ACCESS3
NFSPROC3_ACCESS(ACCESS3args) = 4;
READLINK3
NFSPROC3_READLINK(READLINK3args) = 5;
READ3
NFSPROC3_READ(READ3args) = 6;
WRITE3
NFSPROC3_WRITE(WRITE3args) = 7;
CREATE3
NFSPROC3_CREATE(CREATE3args) = 8;
MKDIR3
NFSPROC3_MKDIR(MKDIR3args) = 9;
SYMLINK3
NFSPROC3_SYMLINK(SYMLINK3args) = 10;
Callaghan, el al Informational [Page 28]
RFC 1813 NFS Version 3 Protocol June 1995
MKNOD3
NFSPROC3_MKNOD(MKNOD3args) = 11;
REMOVE3
NFSPROC3_REMOVE(REMOVE3args) = 12;
RMDIR3
NFSPROC3_RMDIR(RMDIR3args) = 13;
RENAME3
NFSPROC3_RENAME(RENAME3args) = 14;
LINK3
NFSPROC3_LINK(LINK3args) = 15;
READDIR3
NFSPROC3_READDIR(READDIR3args) = 16;
READDIRPLUS3
NFSPROC3_READDIRPLUS(READDIRPLUS3args) = 17;
FSSTAT3
NFSPROC3_FSSTAT(FSSTAT3args) = 18;
FSINFO3
NFSPROC3_FSINFO(FSINFO3args) = 19;
PATHCONF3
NFSPROC3_PATHCONF(PATHCONF3args) = 20;
COMMIT3
NFSPROC3_COMMIT(COMMIT3args) = 21;
} = 3;
} = 100003;
Out of range (undefined) procedure numbers result in
errors. Refer to [RFC1057] for more detail
3.1 General comments on attributes and consistency data on
For those procedures that return either post_op_attr or wcc_
structures on failure, the discriminated union may contain
pre-operation attributes of the object or object
directory. This depends on the error encountered and may
depend on the particular server implementation. Implementors
strongly encouraged to return as much attribute data as
upon failure, but client implementors need to be aware
Callaghan, el al Informational [Page 29]
RFC 1813 NFS Version 3 Protocol June 1995
their implementation must correctly handle the variant
instance where no attributes or consistency data is returned
3.2 General comments on
The following comments apply to all NFS version 3
procedures in which the client provides one or more filenames
the arguments: LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD, REMOVE
RMDIR, RENAME, and LINK
1. The filename must not be null nor may it be the
string. The server should return the error, NFS3ERR_ACCES,
it receives such a filename. On some clients, the filename, ``''
or a null string, is assumed to be an alias for the
directory. Clients which require this functionality
implement it for themselves and not depend upon the server
support such semantics
2. A filename having the value of "." is assumed to be
alias for the current directory. Clients which require
functionality should implement it for themselves and not
upon the server to support such semantics. However, the
should be able to handle such a filename correctly
3. A filename having the value of ".." is assumed to be
alias for the parent of the current directory, i.e.
directory which contains the current directory. The
should be prepared to handle this semantic, if it
directories, even if those directories do not contain UNIX-
"." or ".." entries
4. If the filename is longer than the maximum for the
system (see PATHCONF on page 90, specifically name_max),
result depends on the value of the PATHCONF flag, no_trunc.
no_trunc is FALSE, the filename will be silently truncated
name_max bytes. If no_trunc is TRUE and the filename exceeds
server's file system maximum filename length, the operation
fail with the error, NFS3ERR_NAMETOOLONG
5. In general, there will be characters that a server
not be able to handle as part of a filename. This set
characters will vary from server to server and
implementation to implementation. In most cases, it is
server which will control the client's view of the file system
If the server receives a filename containing characters that
can not handle, the error, NFS3ERR_EACCES, should be returned
Client implementations should be prepared to handle this
affect of heterogeneity
Callaghan, el al Informational [Page 30]
RFC 1813 NFS Version 3 Protocol June 1995
See also comments in File name component handling on page 101.
3.3.0 Procedure 0: NULL - Do
void NFSPROC3_NULL(void) = 0;
Procedure NULL does not do any work. It is made available
allow server response testing and timing
It is important that this procedure do no work at all
that it can be used to measure the overhead of
a service request. By convention, the NULL
should never require any authentication. A server
choose to ignore this convention, in a more
implementation, where responding to the NULL
call acknowledges the existence of a resource to
unauthenticated client
Since the NULL procedure takes no NFS version 3
arguments and returns no NFS version 3 protocol response
it can not return an NFS version 3 protocol error
However, it is possible that some server
may return RPC errors based on security and
requirements
Callaghan, el al Informational [Page 31]
RFC 1813 NFS Version 3 Protocol June 1995
3.3.1 Procedure 1: GETATTR - Get file
GETATTR3res NFSPROC3_GETATTR(GETATTR3args) = 1;
struct GETATTR3args {
nfs_fh3 object
};
struct GETATTR3resok {
fattr3 obj_attributes
};
union GETATTR3res switch (nfsstat3 status) {
case NFS3_OK
GETATTR3resok resok
default
void
};
Procedure GETATTR retrieves the attributes for a
file system object. The object is identified by the
handle that the server returned as part of the
from a LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD,
READDIRPLUS procedure (or from the MOUNT service
described elsewhere). On entry, the arguments
GETATTR3args are
The file handle of an object whose attributes are to
retrieved
On successful return, GETATTR3res.status is NFS3_OK
GETATTR3res.resok contains
obj_
The attributes for the object
Otherwise, GETATTR3res.status contains the error on failure
no other results are returned
The attributes of file system objects is a point of
disagreement between different operating systems.
Callaghan, el al Informational [Page 32]
RFC 1813 NFS Version 3 Protocol June 1995
should make a best attempt to support all of
attributes in the fattr3 structure so that clients
count on this as a common ground. Some mapping may
required to map local attributes to those in the fattr
structure
Today, most client NFS version 3 protocol
implement a time-bounded attribute caching scheme
reduce over-the-wire attribute checks
NFS3ERR_
NFS3ERR_
NFS3ERR_
NFS3ERR_
SEE
ACCESS
3.3.2 Procedure 2: SETATTR - Set file
SETATTR3res NFSPROC3_SETATTR(SETATTR3args) = 2;
union sattrguard3 switch (bool check) {
case TRUE
nfstime3 obj_ctime
case FALSE
void
};
struct SETATTR3args {
nfs_fh3 object
sattr3 new_attributes
sattrguard3 guard
};
struct SETATTR3resok {
wcc_data obj_wcc
};
struct SETATTR3resfail {
wcc_data obj_wcc
};
Callaghan, el al Informational [Page 33]
RFC 1813 NFS Version 3 Protocol June 1995
union SETATTR3res switch (nfsstat3 status) {
case NFS3_OK
SETATTR3resok resok
default
SETATTR3resfail resfail
};
Procedure SETATTR changes one or more of the attributes
a file system object on the server. The new attributes
specified by a sattr3 structure. On entry, the
in SETATTR3args are
The file handle for the object
new_
A sattr3 structure containing booleans
enumerations describing the attributes to be set and the
values for those attributes
A sattrguard3 union
TRUE if the server is to verify that guard.obj_
matches the ctime for the object; FALSE otherwise
A client may request that the server check that the
is in an expected state before performing the
operation. To do this, it sets the argument guard.check
TRUE and the client passes a time value in guard.obj_ctime
If guard.check is TRUE, the server must compare the value
guard.obj_ctime to the current ctime of the object. If
values are different, the server must preserve the
attributes and must return a status of NFS3ERR_NOT_SYNC
If guard.check is FALSE, the server will not perform
check
On successful return, SETATTR3res.status is NFS3_OK
SETATTR3res.resok contains
obj_
A wcc_data structure containing the old and
attributes for the object
Callaghan, el al Informational [Page 34]
RFC 1813 NFS Version 3 Protocol June 1995
Otherwise, SETATTR3res.status contains the error
failure and SETATTR3res.resfail contains the following
obj_
A wcc_data structure containing the old and
attributes for the object
The guard.check mechanism allows the client