Whamcloud - gitweb
LU-2088 utils: lctl to generate gdb symbols for lod/osp
[fs/lustre-release.git] / libcfs / libcfs / fail.c
index d653ee6..494475d 100644 (file)
@@ -1,6 +1,4 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
  * GPL HEADER START
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,6 +25,8 @@
 /*
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright (c) 2012, Whamcloud, Inc.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -73,6 +73,12 @@ int __cfs_fail_check_set(__u32 id, __u32 value, int set)
                         return 0;
         }
 
+        /* check cfs_fail_val... */
+        if (set == CFS_FAIL_LOC_VALUE) {
+                if (cfs_fail_val != -1 && cfs_fail_val != value)
+                        return 0;
+        }
+
         /* Fail cfs_fail_val times, overridden by FAIL_ONCE */
         if (cfs_fail_loc & CFS_FAIL_SOME &&
             (!(cfs_fail_loc & CFS_FAIL_ONCE) || cfs_fail_val <= 1)) {
@@ -100,6 +106,7 @@ int __cfs_fail_check_set(__u32 id, __u32 value, int set)
 
         switch (set) {
                 case CFS_FAIL_LOC_NOSET:
+                case CFS_FAIL_LOC_VALUE:
                         break;
                 case CFS_FAIL_LOC_ORSET:
                         cfs_fail_loc |= value & ~(CFS_FAILED | CFS_FAIL_ONCE);