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

@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.

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.

2 participants