Skip to content

Conversation

@XiaoNi87
Copy link
Collaborator

@XiaoNi87 XiaoNi87 commented Jan 4, 2026

Load md_mod first before setting module parameter legacy_async_del_gendisk Everything works well if md_mod is built in kernel. If not, create and assemble will fail.

Load md_mod first before setting module parameter legacy_async_del_gendisk
Everything works well if md_mod is built in kernel. If not, create and
assemble will fail.

Fixes: d354d31 ("mdadm: Create array with sync del gendisk mode")
Signed-off-by: Xiao Ni <[email protected]>
if (system("modprobe md_mod") == 0)
fd = open(new_array_file, O_WRONLY);
}
if (fd >= 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (!is_fd_valid(fd)){
	pr_err("Fail to open %s\n", new_array_file);
	return 0;
}

n = write(fd, devnm, strlen(devnm));
close(fd);

if (n != (int)strlen(devnm)) {

Looks like simpler.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (!is_fd_valid(fd)){
	pr_err("Fail to open %s\n", new_array_file);
	return 0;
}

n = write(fd, devnm, strlen(devnm));
close(fd);

if (n != (int)strlen(devnm)) {

Looks like simpler.

Hi Mariusz

The codes mentioned above don't have relationship with this problem, right? You mean this part can be improved in this way, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll modify this in another PR for it.

Copy link
Member

@mtkaczyk mtkaczyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small comment, LGTM.

@ncroxon ncroxon self-requested a review January 13, 2026 12:00
@XiaoNi87 XiaoNi87 merged commit b166a20 into md-raid-utilities:main Jan 13, 2026
8 of 9 checks passed
bdrung added a commit to bdrung/dracut-ng that referenced this pull request Jan 16, 2026
Tested with:

```
git-archive && sbuild -s --no-clean-source --run-autopkgtest
```

test results:
waiting for md-raid-utilities/mdadm#228 to be
merged into mdadm

```
lsinitrd             PASS (superficial)
10-basic             PASS
13-sysroot           PASS
40-systemd           PASS
42-systemd-initrd    PASS
43-kernel-install    PASS
80-getarg            PASS
81-skipcpio          PASS
11-usr-mount         PASS
12-uefi              PASS
20-storage           FAIL non-zero exit status 2
26-enc-raid-lvm      FAIL non-zero exit status 2
30-dmsquash          PASS
41-full-systemd      PASS
44-drivers           PASS
50-network           PASS
60-nfs               PASS
70-iscsi             FAIL non-zero exit status 2
71-iscsi-multi       FAIL non-zero exit status 2
72-nbd               PASS
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants