diff options
author | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2023-06-01 09:27:49 +0200 |
---|---|---|
committer | Jes Sorensen <jes@trained-monkey.org> | 2023-10-26 23:28:23 +0200 |
commit | ae5f13a971bc309e0e25087421119b86daf2e510 (patch) | |
tree | abf7fe56135a8b36da993ccdda587857cce46424 /mdadm.h | |
parent | mdadm: refactor ident->name handling (diff) | |
download | mdadm-ae5f13a971bc309e0e25087421119b86daf2e510.tar.xz mdadm-ae5f13a971bc309e0e25087421119b86daf2e510.zip |
mdadm: define ident_set_devname()
Use dedicated set method for ident->devname. Now, devname validation
is done early for modes where device is created (Build, Create and
Assemble). The rules, used for devname validation are derived from
config file.
It could cause regression with execeptional cases where existing device
has name which doesn't match criteria for Manage and Grow modes. It is
low risk and those modes are not omitted from early devname validation.
Use can used main numbered devnode to avoid this problem.
Messages exposed to user are changed so it might cause a regression
in negative scenarios. Error codes are not changed.
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
Diffstat (limited to 'mdadm.h')
-rw-r--r-- | mdadm.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1638,6 +1638,7 @@ extern void manage_fork_fds(int close_all); extern int continue_via_systemd(char *devnm, char *service_name, char *prefix); extern void ident_init(struct mddev_ident *ident); +extern mdadm_status_t ident_set_devname(struct mddev_ident *ident, const char *devname); extern mdadm_status_t ident_set_name(struct mddev_ident *ident, const char *name); extern int parse_auto(char *str, char *msg, int config); @@ -1660,7 +1661,7 @@ extern void print_escape(char *str); extern int use_udev(void); extern unsigned long GCD(unsigned long a, unsigned long b); extern int conf_name_is_free(char *name); -extern bool is_devname_ignore(char *devname); +extern bool is_devname_ignore(const char *devname); extern bool is_devname_md_numbered(const char *devname); extern bool is_devname_md_d_numbered(const char *devname); extern int conf_verify_devnames(struct mddev_ident *array_list); |