1
0
Fork 0

Merging upstream version 4.2+20231121.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-14 06:32:38 +01:00
parent ae2c938e82
commit 5ba18aa35e
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
9 changed files with 307 additions and 150 deletions

View file

@ -23,6 +23,7 @@
*/
#include "mdadm.h"
#include "udev.h"
#include "md_p.h"
#include <ctype.h>
@ -176,7 +177,7 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
char devnm[32];
char cbuf[400];
if (!use_udev())
if (!udev_is_available())
block_udev = 0;
if (chosen == NULL)
@ -335,8 +336,8 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
devnm[0] = 0;
if (num < 0 && cname && ci->names) {
sprintf(devnm, "md_%s", cname);
if (block_udev)
udev_block(devnm);
if (block_udev && udev_block(devnm) != UDEV_STATUS_SUCCESS)
return -1;
if (!create_named_array(devnm)) {
devnm[0] = 0;
udev_unblock();
@ -344,8 +345,8 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
}
if (num >= 0) {
sprintf(devnm, "md%d", num);
if (block_udev)
udev_block(devnm);
if (block_udev && udev_block(devnm) != UDEV_STATUS_SUCCESS)
return -1;
if (!create_named_array(devnm)) {
devnm[0] = 0;
udev_unblock();
@ -368,8 +369,8 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
return -1;
}
}
if (block_udev)
udev_block(devnm);
if (block_udev && udev_block(devnm) != UDEV_STATUS_SUCCESS)
return -1;
create_named_array(devnm);
}
@ -384,7 +385,7 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
* If we cannot detect udev, we need to make
* devices and links ourselves.
*/
if (!use_udev()) {
if (!udev_is_available()) {
/* Make sure 'devname' exists and 'chosen' is a symlink to it */
if (lstat(devname, &stb) == 0) {
/* Must be the correct device, else error */
@ -508,7 +509,7 @@ char *find_free_devnm(int use_partitions)
continue;
if (!conf_name_is_free(devnm))
continue;
if (!use_udev()) {
if (!udev_is_available()) {
/* make sure it is new to /dev too, at least as a
* non-standard */
dev_t devid = devnm2devid(devnm);