Signed-off-by : Vinay Sridhar <vinaysridhar@in.ibm.com>
------Patch-------
diff -Nuarp ltp-full-20080229_old/testcases/kernel/fs/doio/rwtest.sh ltp-full-20080229/testcases/kernel/fs/doio/rwtest.sh
--- ltp-full-20080229_old/testcases/kernel/fs/doio/rwtest.sh	2008-02-29 13:25:43.000000000 +0530
+++ ltp-full-20080229/testcases/kernel/fs/doio/rwtest.sh	2008-03-26 13:41:40.000000000 +0530
@@ -126,6 +126,15 @@ cleanup_and_exit()
 	exit $1
 }
 
+# Check if the current filesystem is NFS
+
+STR=`stat -f . | grep "Type: nfs"`
+if [ STR != "" ]; then
+        tst_resm TCONF "Cannot run rwtest on an NFS mounted filesystem"
+        exit 0
+fi
+
+
 while (( $# > 0 ))
 do	case $1 in
 	-c)	Remove_Test_Files=yes
diff -Nuarp ltp-full-20080229_old/testcases/kernel/io/direct_io/diotest4.c ltp-full-20080229/testcases/kernel/io/direct_io/diotest4.c
--- ltp-full-20080229_old/testcases/kernel/io/direct_io/diotest4.c	2008-02-29 13:25:42.000000000 +0530
+++ ltp-full-20080229/testcases/kernel/io/direct_io/diotest4.c	2008-03-26 13:41:02.000000000 +0530
@@ -194,6 +194,14 @@ main(int argc, char *argv[])
 	caddr_t	shm_base;
 	struct	sigaction act;
 
+	/*
+        * check if the current filesystem is nfs
+        */
+	if(tst_is_cwd_nfs()) {
+                tst_resm(TCONF, "Cannot do direct-io on a file located on an NFS filesystem");
+                return 0;
+        }
+
 	/* Options */
 	while ((i = getopt(argc, argv, "b:")) != -1) {
 		switch(i) {
diff -Nuarp ltp-full-20080229_old/testcases/kernel/syscalls/fcntl/fcntl23.c ltp-full-20080229/testcases/kernel/syscalls/fcntl/fcntl23.c
--- ltp-full-20080229_old/testcases/kernel/syscalls/fcntl/fcntl23.c	2008-02-29 13:25:45.000000000 +0530
+++ ltp-full-20080229/testcases/kernel/syscalls/fcntl/fcntl23.c	2008-03-26 13:42:09.000000000 +0530
@@ -126,6 +126,13 @@ main(int ac, char **av)
      ***************************************************************/
     setup();
 
+    /*
+     * check if the current filesystem is nfs
+     */
+    if(tst_is_cwd_nfs()) {
+         tst_brkm(TCONF, cleanup, "Cannot do fcntl on a file located on an NFS filesystem");
+    }
+
     /* set the expected errnos... */
     TEST_EXP_ENOS(exp_enos);
 
diff -Nuarp ltp-full-20080229_old/testcases/kernel/syscalls/fcntl/fcntl24.c ltp-full-20080229/testcases/kernel/syscalls/fcntl/fcntl24.c
--- ltp-full-20080229_old/testcases/kernel/syscalls/fcntl/fcntl24.c	2008-02-29 13:25:45.000000000 +0530
+++ ltp-full-20080229/testcases/kernel/syscalls/fcntl/fcntl24.c	2008-03-26 13:42:17.000000000 +0530
@@ -126,6 +126,13 @@ main(int ac, char **av)
      ***************************************************************/
     setup();
 
+    /*
+     * check if the current filesystem is nfs
+     */
+    if(tst_is_cwd_nfs()) {
+         tst_brkm(TCONF, cleanup, "Cannot do fcntl on a file located on an NFS filesystem");
+    }
+
     /* set the expected errnos... */
     TEST_EXP_ENOS(exp_enos);
 
diff -Nuarp ltp-full-20080229_old/testcases/kernel/syscalls/fcntl/fcntl25.c ltp-full-20080229/testcases/kernel/syscalls/fcntl/fcntl25.c
--- ltp-full-20080229_old/testcases/kernel/syscalls/fcntl/fcntl25.c	2008-02-29 13:25:45.000000000 +0530
+++ ltp-full-20080229/testcases/kernel/syscalls/fcntl/fcntl25.c	2008-03-26 13:42:28.000000000 +0530
@@ -127,6 +127,13 @@ main(int ac, char **av)
      ***************************************************************/
     setup();
 
+    /*
+     * check if the current filesystem is nfs
+     */
+    if(tst_is_cwd_nfs()) {
+            tst_brkm(TCONF, cleanup, "Cannot do fcntl on a file located on an NFS filesystem");
+    }
+
     /* set the expected errnos... */
     TEST_EXP_ENOS(exp_enos);
 
diff -Nuarp ltp-full-20080229_old/testcases/kernel/syscalls/fcntl/fcntl26.c ltp-full-20080229/testcases/kernel/syscalls/fcntl/fcntl26.c
--- ltp-full-20080229_old/testcases/kernel/syscalls/fcntl/fcntl26.c	2008-02-29 13:25:45.000000000 +0530
+++ ltp-full-20080229/testcases/kernel/syscalls/fcntl/fcntl26.c	2008-03-26 13:42:33.000000000 +0530
@@ -127,6 +127,13 @@ main(int ac, char **av)
      ***************************************************************/
     setup();
 
+    /*
+     * check if the current filesystem is nfs
+     */
+    if(tst_is_cwd_nfs()) {
+            tst_brkm(TCONF, cleanup, "Cannot do fcntl on a file located on an NFS filesystem");
+    }
+
     /* set the expected errnos... */
     TEST_EXP_ENOS(exp_enos);
 
diff -Nuarp ltp-full-20080229_old/testcases/kernel/syscalls/splice/splice01.c ltp-full-20080229/testcases/kernel/syscalls/splice/splice01.c
--- ltp-full-20080229_old/testcases/kernel/syscalls/splice/splice01.c	2008-02-29 13:25:44.000000000 +0530
+++ ltp-full-20080229/testcases/kernel/syscalls/splice/splice01.c	2008-03-26 13:39:44.000000000 +0530
@@ -99,6 +99,14 @@ int main(int ac, char **av)
 	setup();
 
 	/*
+	* check if the current filesystem is nfs
+	*/	
+	if(tst_is_cwd_nfs()) {
+                tst_brkm(TCONF, cleanup, "Cannot do splice on a file located on an NFS filesystem");
+        }
+
+
+	/*
 	 * check looping state if -c option given
 	 */
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
diff -Nuarp ltp-full-20080229_old/testcases/kernel/syscalls/utime/utime01.c ltp-full-20080229/testcases/kernel/syscalls/utime/utime01.c
--- ltp-full-20080229_old/testcases/kernel/syscalls/utime/utime01.c	2008-02-29 13:25:44.000000000 +0530
+++ ltp-full-20080229/testcases/kernel/syscalls/utime/utime01.c	2008-03-26 13:40:12.000000000 +0530
@@ -115,6 +115,13 @@ main(int ac, char **av)
 	/* Perform global setup for test */
 	setup();
 
+ 	/*
+        * check if the current filesystem is nfs
+        */      
+        if(tst_is_cwd_nfs()) {
+                tst_brkm(TCONF, cleanup, "Cannot do utime on a file located on an NFS filesystem");
+        }
+
 	/* set the expected errnos... */
 	TEST_EXP_ENOS(exp_enos);
 
diff -Nuarp ltp-full-20080229_old/testcases/kernel/syscalls/utime/utime02.c ltp-full-20080229/testcases/kernel/syscalls/utime/utime02.c
--- ltp-full-20080229_old/testcases/kernel/syscalls/utime/utime02.c	2008-02-29 13:25:44.000000000 +0530
+++ ltp-full-20080229/testcases/kernel/syscalls/utime/utime02.c	2008-03-26 13:40:18.000000000 +0530
@@ -121,6 +121,13 @@ main(int ac, char **av)
 	/* Perform global setup for test */
 	setup();
 
+ 	/*
+        * check if the current filesystem is nfs
+        */      
+        if(tst_is_cwd_nfs()) {
+                tst_brkm(TCONF, cleanup, "Cannot do utime on a file located on an NFS filesystem");
+        }
+
 	/* set the expected errnos... */
 	TEST_EXP_ENOS(exp_enos);
 
diff -Nuarp ltp-full-20080229_old/testcases/kernel/syscalls/utime/utime03.c ltp-full-20080229/testcases/kernel/syscalls/utime/utime03.c
--- ltp-full-20080229_old/testcases/kernel/syscalls/utime/utime03.c	2008-02-29 13:25:44.000000000 +0530
+++ ltp-full-20080229/testcases/kernel/syscalls/utime/utime03.c	2008-03-26 13:40:25.000000000 +0530
@@ -131,6 +131,13 @@ main(int ac, char **av)
 	/* Perform global setup for test */
 	setup();
 
+	/*
+        * check if the current filesystem is nfs
+        */
+        if(tst_is_cwd_nfs()) {
+                tst_brkm(TCONF, cleanup, "Cannot do utime on a file located on an NFS filesystem");
+        }
+
 	/* set the expected errnos... */
 	TEST_EXP_ENOS(exp_enos);
 
diff -Nuarp ltp-full-20080229_old/testcases/network/nfs/nfs01/nfs01 ltp-full-20080229/testcases/network/nfs/nfs01/nfs01
--- ltp-full-20080229_old/testcases/network/nfs/nfs01/nfs01	2008-02-29 13:25:52.000000000 +0530
+++ ltp-full-20080229/testcases/network/nfs/nfs01/nfs01	2008-03-26 16:36:52.000000000 +0530
@@ -196,6 +196,14 @@ $trace_logic
 # MAIN PROCEDURE
 #=============================================================================
 
+# Check if current filesystem is NFS
+
+STR=`stat -f . | grep "Type: nfs"`
+if [ STR != "" ]; then
+        test_resm TCONF "Cannot run nfs stress test on an NFS mounted filesystem"
+        exit 0
+fi
+
 setup_testcase
 do_test
 end_testcase
