bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rename() over NFS


From: Bruno Haible
Subject: Re: rename() over NFS
Date: Sat, 25 Dec 2010 15:27:27 +0100
User-agent: KMail/1.9.9

A followup to 2010-11-13
<http://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00180.html>:

On a Linux 2.6.16.60 machine, I still get failures from 'test-rename'
and 'test-renameat' over NFS:

  test-rename.h:279: assertion failed
  FAIL: test-renameat 

The reason is that the mkdir() call at line 279 fails with EEXIST
because the old directory name is still in the stat() cache.

This change makes the tests succeed. OK to commit?


2010-12-25  Bruno Haible  <address@hidden>

        rename, renameat: Avoid test failures at NFS mounted locations.
        * tests/test-rename.h (assert_nonexistent): Remove the old directory,
        so that subsequent mkdir calls succeed.

--- tests/test-rename.h.orig    Sat Dec 25 15:20:33 2010
+++ tests/test-rename.h Sat Dec 25 15:20:07 2010
@@ -56,11 +56,16 @@
   if (stat (filename, &st) == -1)
     ASSERT (errno == ENOENT);
   else
-    /* But after renaming a directory over an empty directory on an NFS-mounted
-       file system, on Linux 2.6.18, for a period of 30 seconds the old
-       directory name is "present" according to stat() but "nonexistent"
-       according to dentry_exists().  */
-    ASSERT (!dentry_exists (filename));
+    {
+      /* But after renaming a directory over an empty directory on an NFS-
+         mounted file system, on Linux 2.6.18, for a period of 30 seconds the
+         old directory name is "present" according to stat() but "nonexistent"
+         according to dentry_exists().  */
+      ASSERT (!dentry_exists (filename));
+      /* Remove the old directory name, so that subsequent mkdir calls
+         succeed.  */
+      (void) rmdir (filename);
+    }
 }
 
 static int



reply via email to

[Prev in Thread] Current Thread [Next in Thread]