]> git.ipfire.org Git - thirdparty/mdadm.git/commit
mdadm: refactor ident->name handling
authorMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Thu, 1 Jun 2023 07:27:48 +0000 (09:27 +0200)
committerJes Sorensen <jes@trained-monkey.org>
Thu, 26 Oct 2023 21:28:23 +0000 (17:28 -0400)
commit67417d9222c505103357191bb0e0ae300892e8a9
treeec4990547c9556b08af0b7a098f44d4b9622eeae
parent330c07f8e4d26f4f2d068e11f09c9df8a3380087
mdadm: refactor ident->name handling

Create dedicated setter for name in mddev_ident and propagate it.
Following changes are made:
- move duplicated code from  config.c and mdadm.c into new function.
- Add error enum in mdadm.h.
- Use MD_NAME_MAX instead of hardcoded value in mddev_ident.
- Use secure functions.
- Add more detailed verification of the name.
- make error messages reusable for cmdline and config:
    - for cmdline, these are errors so use pr_err().
    - for config, these are just warnings, so use pr_info().

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
config.c
lib.c
mdadm.c
mdadm.h