Whamcloud - gitweb
LU-4961 lustre: remove liblustre.h and obd.h from userspace
[fs/lustre-release.git] / libcfs / libcfs / fail.c
index 509c3c2..4315bb3 100644 (file)
  * Lustre is a trademark of Oracle Corporation, Inc.
  */
 
-#ifndef __KERNEL__
-#include <liblustre.h>
-#else
 #include <libcfs/libcfs.h>
-#endif
 
 unsigned long cfs_fail_loc = 0;
 unsigned int cfs_fail_val = 0;
@@ -93,8 +89,9 @@ int __cfs_fail_check_set(__u32 id, __u32 value, int set)
                }
        }
 
-       if ((set == CFS_FAIL_LOC_ORSET || set == CFS_FAIL_LOC_RESET) &&
-           (value & CFS_FAIL_ONCE))
+       /* Take into account the current call for FAIL_ONCE for ORSET only,
+        * as RESET is a new fail_loc, it does not change the current call */
+       if ((set == CFS_FAIL_LOC_ORSET) && (value & CFS_FAIL_ONCE))
                set_bit(CFS_FAIL_ONCE_BIT, &cfs_fail_loc);
        /* Lost race to set CFS_FAILED_BIT. */
        if (test_and_set_bit(CFS_FAILED_BIT, &cfs_fail_loc)) {