As of now, test cases utilizing tst_checkpoint framework fail on NFS
with similar errors:

creat07     0  TWARN  :  tst_tmpdir.c:206: tst_rmdir: 
rmobj(/tmpdir/ltp-0IVQPP0NK6/creigi0kV) failed: 
remove(/tmpdir/ltp-0IVQPP0NK6/creigi0kV) failed; errno=66: Directory not empty

This happens because we keep the futex page mapped while tst_rmdir() is running.

Let's unmap it before the actual delete procedure.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmansk...@oracle.com>
---
 lib/tst_checkpoint.c |    2 +-
 lib/tst_tmpdir.c     |   11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/lib/tst_checkpoint.c b/lib/tst_checkpoint.c
index 0e2c402..36eeff2 100644
--- a/lib/tst_checkpoint.c
+++ b/lib/tst_checkpoint.c
@@ -33,7 +33,7 @@
 
 #define DEFAULT_MSEC_TIMEOUT 10000
 
-static futex_t *futexes;
+futex_t *futexes;
 static int page_size;
 
 void tst_checkpoint_init(const char *file, const int lineno,
diff --git a/lib/tst_tmpdir.c b/lib/tst_tmpdir.c
index dd82f35..6a6c0c0 100644
--- a/lib/tst_tmpdir.c
+++ b/lib/tst_tmpdir.c
@@ -57,6 +57,7 @@
  *
  *********************************************************/
 
+#include <sys/mman.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <assert.h>
@@ -70,6 +71,7 @@
 #include "test.h"
 #include "rmobj.h"
 #include "ltp_priv.h"
+#include "lapi/futex.h"
 
 /*
  * Define some useful macros.
@@ -97,6 +99,8 @@ static char *TESTDIR = NULL;  /* the directory created */
 
 static char test_start_work_dir[PATH_MAX];
 
+/* lib/tst_checkpoint.c */
+extern futex_t *futexes;
 
 int tst_tmpdir_created(void)
 {
@@ -199,6 +203,13 @@ void tst_rmdir(void)
        }
 
        /*
+        * Unmap the backend file.
+        * This is needed to overcome the NFS "silly rename" feature.
+        */
+       if (futexes)
+               munmap((void *)futexes, getpagesize());
+
+       /*
         * Attempt to remove the "TESTDIR" directory, using rmobj().
         */
        if (rmobj(TESTDIR, &errmsg) == -1) {
-- 
1.7.1


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to