-
Notifications
You must be signed in to change notification settings - Fork 42
mdadm: load md_mod first #228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
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.
mtkaczyk
left a comment
There was a problem hiding this 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.
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 ```
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.