]> git.tuebingen.mpg.de Git - aple.git/blobdiff - Filesystems.m4
Unix_Concepts: Only mark up I/O operations as code and not comma
[aple.git] / Filesystems.m4
index ca894346e55d865ee7171c1052c22a01a005acf4..40dedd1aca314193f2748c886aad706533223604 100644 (file)
@@ -1316,15 +1316,43 @@ operations. With close-to-open cache consistency the green client is
 guaranteed to see the write operation of the blue client while there
 is no such guarantee for the red client. </p>
 
 guaranteed to see the write operation of the blue client while there
 is no such guarantee for the red client. </p>
 
-SUBSECTION(«Delegations»)
-
-nfs4 introduced a feature called <em>file delegation</em>. A file
-delegation allows the client to treat a file temporarily as if no
-other client is accessing it.  Once a file has been delegated to a
-client, the client might cache all write operations for this file,
-and only contact the server when memory pressure forces the client
-to free memory by writing back file contents. The server notifies
-the client if another client attempts to access that file.
+SUBSECTION(«File and Directory Delegations»)
+
+<p> nfs4 introduced a per-file state management feature called
+<em>file delegation</em>. Once a file has been delegated to a client,
+the server blocks write access to the file for other nfs clients and
+for local processes. Therefore the client may assume that the file
+does not change unexpectedly. This cache-coherency guarantee can
+improve performance because the client may cache all write operations
+for this file, and only contact the server when memory pressure forces
+the client to free memory by writing back file contents. </p>
+
+<p> A drawback of file delegations is that they delay conflicting open
+requests by other clients because existing delegations must be recalled
+before the open request completes. This is particularly important if
+an nfs client which is holding a delegation gets disconnected from
+the network. To detect this condition, clients report to the server
+that they are still alive by periodically sending a <code>RENEW</code>
+request. If no such request has arrived for the <em>lease time</em>
+(typically 90 seconds), the server may recall any delegations it
+has granted to the disconnected client. This allows accesses from
+other clients that would normally be prevented because of the
+delegation. </p>
+
+<p> However, the server is not obliged to recall <em>uncontested</em>
+delegations for clients whose lease period has expired. In fact,
+newer Linux NFS server implementations retain the uncontested
+state of unresponsive clients for up to 24 hours. This so-called
+<em>courteous server</em> feature was introduced in Linux-5.19
+(released in 2022). </p>
+
+<p> Let us finally remark that the delegations as discussed above
+work only for regular files. NFS versions up to and including 4.0
+do not grant delegations for directories. With nfs4.1 an nfs client
+may ask the server to be notified whenever changes are made to the
+directory by another client. Among other benefits, this feature allows
+for <em>strong directory cache coherency</em>. However, as of 2022,
+directory delegations are not yet implemented by Linux. </p>
 
 SUBSECTION(«Silly Renames and Stale File Handles»)
 
 
 SUBSECTION(«Silly Renames and Stale File Handles»)
 
@@ -1357,7 +1385,7 @@ silly renames: An NFS4.1 server knows when it its safe to unlink a
 file and communicates this information to the client. </p>
 
 <p> The file handle which an nfs client received through some earlier
 file and communicates this information to the client. </p>
 
 <p> The file handle which an nfs client received through some earlier
-rpc can become invalid at any time due to operations on different
+rpc can become invalid at any time due to operations on different
 hosts. This happens, for example, if the file was deleted on the server
 or on a different nfs client, or when the directory that contains
 the file is no longer exported by the server due to a configuration
 hosts. This happens, for example, if the file was deleted on the server
 or on a different nfs client, or when the directory that contains
 the file is no longer exported by the server due to a configuration
@@ -1404,7 +1432,7 @@ EXERCISES()
        <li> In an nfs-mounted directory (nfs version 4.0 or earlier), run
        <code>cat > foo &</code>. Note that the cat process automatically
        receives the STOP signal. Run <code>rm foo; ls -ltra</code>. Read
        <li> In an nfs-mounted directory (nfs version 4.0 or earlier), run
        <code>cat > foo &</code>. Note that the cat process automatically
        receives the STOP signal. Run <code>rm foo; ls -ltra</code>. Read
-       section D2 of the <a href="http://nfs.sourceforge.net/">nfs HOWTO</a>
+       section D2 of the <a href="https://nfs.sourceforge.net/">nfs HOWTO</a>
        for the explanation. </li>
 
        <li> In an nfs-mounted directory, run <code>{ while :; do echo; sleep
        for the explanation. </li>
 
        <li> In an nfs-mounted directory, run <code>{ while :; do echo; sleep
@@ -1413,7 +1441,7 @@ EXERCISES()
 
        <li> Discuss the pros and cons of hard vs. soft mounts. </li>
 
 
        <li> Discuss the pros and cons of hard vs. soft mounts. </li>
 
-       <li> Read section A10 of the <a href="http://nfs.sourceforge.net/">nfs
+       <li> Read section A10 of the <a href="https://nfs.sourceforge.net/">nfs
        HOWTO</a> to learn about common reasons for stale nfs handles. </li>
 
        <li> Can every local filesystem be exported via nfs? </li>
        HOWTO</a> to learn about common reasons for stale nfs handles. </li>
 
        <li> Can every local filesystem be exported via nfs? </li>
@@ -1480,9 +1508,12 @@ SECTION(«Further Reading»)
        <li> Dominic Giampaolo: Practical File System Design </li>
        <li> Cormen </li>
        <li> Darrick Wong: XFS Filesystem Disk Structures </li>
        <li> Dominic Giampaolo: Practical File System Design </li>
        <li> Cormen </li>
        <li> Darrick Wong: XFS Filesystem Disk Structures </li>
-       <li> The <a href="https://xfs.org/index.php/Main_Page">xfs FAQ</a> </li>
        <li> Documentation/filesystems/path-lookup.rst </li>
        <li> rfc 5531: Remote Procedure Call Protocol, Version 2 (2009) </li>
        <li> Birell, A.D. and Nelson, B.J.: Implementing Remote Procedure Calls
        (1984) </li>
        <li> Documentation/filesystems/path-lookup.rst </li>
        <li> rfc 5531: Remote Procedure Call Protocol, Version 2 (2009) </li>
        <li> Birell, A.D. and Nelson, B.J.: Implementing Remote Procedure Calls
        (1984) </li>
+       <li> <a href="https://lwn.net/Articles/897917/">NFS: the early
+       years</a> and <a href="https://lwn.net/Articles/898262/">NFS: the new
+       millennium</a>, two articles on the design and history of NFS by Neil
+       Brown. </li>
 </ul>
 </ul>