-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Medium
-
None
-
Affects Version/s: None
-
None
-
3
-
9223372036854775807
Every new fail point needs a hand-picked number in lustre/include/obd_support.h, and every test that uses it hard-codes that number. Many open patches add OBD_FAIL_* values at the end of the same subsystem block. Their values are unique, but the added lines conflict with each other, so the patches need repeated rebases. Picking numbers by hand has also led to duplicate values (LU-20275), and test comments have given the wrong name for the number they set (LU-11259).
Proposal:
- Add CFS_FAIL_NAMED(NAME). It returns a fail ID that is a hash of the name, in the range 0x00010000-0x01FFFFFF. It works with all existing CFS_FAIL_/OBD_FAIL_ check macros. The ID is computed only while a fail_loc is set, and cached at each call site.
- Widen CFS_FAIL_MASK_LOC to 0x01FFFFFF. Bits 0x01FF0000 are unused today, so existing values keep their meaning.
- Let lctl set_param fail_loc= accept a name plus optional flag tokens, for example fail_loc=MDT_RENAME_PAUSE,once or fail_loc=MDT_RENAME_PAUSE,0x80000000. The kernel hashes the name and keeps it for the console message. Reading fail_loc still returns a number.
- New fail points use names and need no entry in obd_support.h. Existing numeric values stay as they are, for interop testing.
- Add a build-time check for hash collisions between names, and for names used in tests that no source file defines. Make checkpatch warn on new numeric OBD_FAIL_* defines.
Interop: an older node rejects a name with -EINVAL, so a test without a proper version check fails loudly instead of silently injecting nothing.
- is related to
-
LU-16636 some tests don't hit fail_loc
-
- Open
-