summaryrefslogtreecommitdiffstats
path: root/mapfile.c (unfollow)
Commit message (Collapse)AuthorFilesLines
3 daysmdopen: add sbin path to env PATH when call system("modprobe md_mod")Coly Li1-0/+18
During the boot process if mdadm is called in udev context, sbin paths like /sbin, /usr/sbin, /usr/local/sbin normally not defined in PATH env variable, calling system("modprobe md_mod") in create_named_array() may fail with 'sh: modprobe: command not found' error message. We don't want to move modprobe binary into udev private directory, so setting the PATH env is a more proper method to avoid the above issue. This patch sets PATH env variable with "/sbin:/usr/sbin:/usr/local/sbin" before calling system("modprobe md_mod"). The change only takes effect within the udev worker context, not seen by global udev environment. Signed-off-by: Coly Li <colyli@suse.de> Signed-off-by: Mariusz Tkaczyk <mtkaczyk@kernel.org>
12 daysmdadm/raid6check: add xmalloc.h to raid6check.cXiao Ni1-0/+1
It reports building error: raid6check.c:324:26: error: implicit declaration of function xmalloc Add xmalloc.h to raid6check.c file to fix this. Signed-off-by: Xiao Ni <xni@redhat.com> Link: https://lore.kernel.org/r/20250117071540.4094-1-xni@redhat.com Signed-off-by: Song Liu <song@kernel.org>
2025-01-13Refactor continue_via_systemd()Mateusz Kusiak3-21/+26
Refactor continue_via_systemd() and it's calls to make it more readable. No functional changes. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
2025-01-13Better error messages for broken reshapeMateusz Kusiak2-1/+3
mdadm --grow --continue has no functionality to restore critical sectors if reshape was stopped during operation. This functionality belongs to assemble or incremental. This patch adds hints to error messages, to try to reassemble array in case of reshape failure to restore critical sector, so assemble can handle restoration. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
2025-01-13mdadm: Do not start reshape before switchrootMateusz Kusiak4-27/+61
There are numerous issues for --grow --continue in switchroot phrase, they include: * Events being missed for restarting grow-continue service. This is apparent mostly on OS on RAID scenarios. When a checkpoint (next step) is committed, we have no reliable way to gracefully stop reshape until it reaches that checkpoint. During boot, there's heavy I/O utilisation, which causes sync speed drop, and naturally checkpoint takes longer to reach. This further causes systemd to forcefully kill grow-continue service due to timeouts, which results in udev event being missed for grow-continue service restart. * Grow-continue (seemingly) was not designed to be restarted without reassembly, some things like stopping chunksize (to lower) migration were straight up not working until recently. This patch makes grow-continue (actual reshape) start after switchroot phrase. This way we should not encounter issues related to restarting the service. Add checks not start a reshape if in initrd, let it initialise only. Change grow-continue udev rule to be triggered whenever there's a reshape happening in metadata, rely on udev event to kick reshape after switchroot. Add handle_forking helper function for reshapes to avoid duplicating code. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
2025-01-13Detail: Export reshape statusMateusz Kusiak1-0/+3
Display if there's an ongoing reshape happening in mdadm --detail --export output. This change is needed for incoming patches that will change "grow continue" udev rules, to be based on actual array state. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
2025-01-13Remove --freeze-reshape logicMateusz Kusiak5-69/+7
This commit removes --freeze-reshape logic, it basicaly reverts commit b76b30e0f950 ("Do not continue reshape during initrd phase"). --freeze-reshape was supposed to be used to restore critical sector in incremental and assemble operations without starting a reshape process, but it's meaning has been lost through the years and it is not currently used. A replacement for this logic will be added in incoming patches, so reshapes won't be started in initrd phrase. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
2025-01-10mdadm.man: Remove external bitmapMariusz Tkaczyk1-49/+6
Remove external bitmap support from manual. Signed-off-by: Mariusz Tkaczyk <mtkaczyk@kernel.org>