From 63ef3ef23517d1f63b4a17da8cecb88b8fa1ebdf Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 10 Jul 2022 13:45:56 +0200 Subject: [PATCH] fs: Improve text on NFS silly renames. Mention the rmdir problem and that as of nfs4.1 silly renames are a thing of the past. Adjust the exercise which asks the reader to create a silly-renamed file accordingly. --- Filesystems.m4 | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Filesystems.m4 b/Filesystems.m4 index 75d0725..ca89434 100644 --- a/Filesystems.m4 +++ b/Filesystems.m4 @@ -1345,11 +1345,16 @@ is still open. Only after all the last file descriptor that refers to the thusly silly-renamed file is closed, the client removes the file by issuing an appropriate rpc.

-

This approach is not perfect. For one, if the client crashes, -a stale .nfs12345 file remains on the server. Second, -since silly renames are only known to the nfs client, bad things -happen if a different client removes the file.

- +

This approach is not perfect. For one, if the client crashes, a +stale .nfs12345 file remains on the server. Second, since +silly renames are only known to the nfs client, bad things happen if a +different client removes the file. Finally, if an application running +on a client removes the last regular file in a directory, and this +file got silly-renamed because it was still held open, a subsequent +rmdir will fail unexpectedly with Directory not +empty. Version 4.1 of the NFS protocol finally got rid of +silly renames: An NFS4.1 server knows when it its safe to unlink a +file and communicates this information to the client.

The file handle which an nfs client received through some earlier rpc can become invalid at any time due to operations on a different @@ -1396,11 +1401,11 @@ EXERCISES()

  • On an nfs server, run collectl -s F -i 5 and discuss the output.
  • -
  • In an nfs-mounted directory, run cat > foo &. Note - that the cat process automatically receives the STOP signal. - Run rm foo; ls -ltra. Read section D2 of the - nfs HOWTO for the - explanation.
  • +
  • In an nfs-mounted directory (nfs version 4.0 or earlier), run + cat > foo &. Note that the cat process automatically + receives the STOP signal. Run rm foo; ls -ltra. Read + section D2 of the nfs HOWTO + for the explanation.
  • In an nfs-mounted directory, run { while :; do echo; sleep 1; done; } > baz &. What happens if you remove the file on a -- 2.30.2