summaryrefslogtreecommitdiffstats
path: root/msg.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-01-04Manage&Incremental: code refactor, string to enumMateusz Kusiak5-33/+45
Prepare Manage and Incremental for later changing context->update to enum. Change update from string to enum in multiple functions and pass enum where already possible. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
2023-01-04Change update to enum in update_super and update_subarrayMateusz Kusiak9-62/+52
Use already existing enum, change update_super and update_subarray update to enum globally. Refactor function references also. Remove code specific options from update_options. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
2023-01-04super-intel: refactor the code for enumMateusz Kusiak1-12/+25
It prepares super-intel for change context->update to enum. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
2023-01-04super1: refactor the code for enumMateusz Kusiak1-61/+91
It prepares update_super1 for change context->update to enum. Change if else statements into switch. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
2023-01-04super0: refactor the code for enumMateusz Kusiak1-39/+63
It prepares update_super0 for change context->update to enum. Change if else statements to switch. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
2023-01-04super-ddf: Remove update_super_ddf.Mateusz Kusiak1-70/+0
This is not supported by ddf. It hides errors by returning success status for some updates. Remove update_super_dff(). Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
2023-01-04Add code specific update options to enum.Mateusz Kusiak2-0/+36
Some of update options aren't taken from user input, but are hard-coded as strings. Include those options in enum. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
2023-01-04Fix --update-subarray on active volumeMateusz Kusiak2-5/+7
Options: bitmap, ppl and name should not be updated when array is active. Those features are mutually exclusive and share the same data area in IMSM (danger of overwriting by kernel). Remove check for active subarrays from super-intel. Since ddf is not supported, apply it globally for all options. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
2023-01-04mdadm: Add option validation for --update-subarrayMateusz Kusiak4-74/+124
Subset of options available for "--update" is not same as for "--update-subarray". Define maps and enum for update options and use them instead of direct comparisons. Add proper error message. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
2022-12-28mdadm: create ident_init()Mariusz Tkaczyk3-32/+36
Add a wrapper for repeated initializations in mdadm.c and config.c. Move includes up. Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
2022-12-28Grow: fix possible memory leak.Blazej Kucman1-1/+4
Signed-off-by: Blazej Kucman <blazej.kucman@intel.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
2022-12-28Update mdadm Monitor manual.Blazej Kucman1-21/+50
- describe monitor work modes, - clarify the turning off condition, - describe the mdmonitor.service as a prefered management way. Signed-off-by: Blazej Kucman <blazej.kucman@intel.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
2022-12-28Monitor: block if monitor modes are combined.Blazej Kucman1-1/+6
Block monitoring start if --scan mode and MD devices list are combined. Signed-off-by: Blazej Kucman <blazej.kucman@intel.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
2022-12-28Mdmonitor: Split alert() into separate functionsMateusz Grzonka1-91/+95
Signed-off-by: Mateusz Grzonka <mateusz.grzonka@intel.com> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
2022-09-29Mdmonitor: Omit non-md devicesLukasz Florczak1-8/+4
Fix segfault commit [1] introduced check whether given device is mddevice, but it happend to terminate Mdmonitor if at least one of given devices didn't fulfill that condition. In result Mdmonitor service was no longer started on boot (with --scan option) when config contained some non-existent array entry. This commit introduces ommiting non-md devices so scan option can still be used when config is wrong and allow Mdmonitor service to run on boot. Giving a list of devices to monitor containing non-existing or non-md devices will result in monitoring only confirmed mddevices. [1] https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/commit/?id=e702f392959d1c2ad2089e595b52235ed97b4e18 Signed-off-by: Lukasz Florczak <lukasz.florczak@linux.intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2022-09-29mdadm: replace container level checking with inlineKinga Tanska10-20/+33
To unify all containers checks in code, is_container() function is added and propagated. Signed-off-by: Kinga Tanska <kinga.tanska@intel.com> Acked-by: Coly Li <colyli@suse.de> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2022-09-16ReadMe: fix command-line helpMariusz Tkaczyk1-1/+1
Make command-line help consistent with manual page. Copied from Debian. Cc: Felix Lechner <felix.lechner@lease-up.com> Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Acked-by: Coly Li <colyli@suse.de> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2022-09-16mdadm: Add Documentation entries to systemd servicesMariusz Tkaczyk7-1/+8
Add documentation section. Copied from Debian. Cc: Felix Lechner <felix.lechner@lease-up.com> Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Acked-by: Coly Li <colyli@suse.de> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2022-09-14mdadm: added support for Intel Alderlake RST on VMD platformOldřich Jedlička1-5/+13
Alderlake RST on VMD uses RstVmdV UEFI variable name, so detect it. Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com> Reviewed-by: Kinga Tanska <kinga.tanska@linux.intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2022-09-08Monitor: Fix statelist memory leaksPawel Baldysiak1-9/+31
Free statelist in error path in Monitor initialization. Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2022-09-08Manage: Block unsafe member failingMateusz Kusiak1-1/+52
Kernel may or may not block mdadm from removing member device if it will cause arrays failed state. It depends on raid personality implementation in kernel. Add verification on requested removal path (#mdadm --set-faulty command). Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2022-09-08mdadm: Correct typos, punctuation and grammar in manMateusz Grzonka1-90/+88
Signed-off-by: Mateusz Grzonka <mateusz.grzonka@intel.com> Reviewed-by: Wol <anthony@youngman.org.uk> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2022-08-29super1: report truncated deviceNeilBrown1-7/+28
When the metadata is at the start of the device, it is possible that it describes a device large than the one it is actually stored on. When this happens, report it loudly in --examine. .... Unused Space : before=1968 sectors, after=-2047 sectors DEVICE TOO SMALL State : clean TRUNCATED DEVICE .... Also report in --assemble so that the failure which the kernel will report will be explained. mdadm: Device /dev/sdb is not large enough for data described in superblock mdadm: no RAID superblock on /dev/sdb mdadm: /dev/sdb has no superblock - assembly aborted Scenario can be demonstrated as follows: mdadm: Note: this array has metadata at the start and may not be suitable as a boot device. If you plan to store '/boot' on this device please ensure that your boot-loader understands md/v1.x metadata, or use --metadata=0.90 mdadm: Defaulting to version 1.2 metadata mdadm: array /dev/md/test started. mdadm: stopped /dev/md/test Unused Space : before=1968 sectors, after=-2047 sectors DEVICE TOO SMALL State : clean TRUNCATED DEVICE Unused Space : before=1968 sectors, after=-2047 sectors DEVICE TOO SMALL State : clean TRUNCATED DEVICE Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2022-08-24Assemble: check if device is container before scheduling force-clean updateKinga Tanska1-3/+2
Up to now using assemble with force flag making each array as clean. Force-clean should not be done for the container. This commit add check if device is different than container before cleaning. Signed-off-by: Kinga Tanska <kinga.tanska@intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2022-08-24Grow: Split Grow_reshape into helper functionMateusz Kusiak3-59/+81
Grow_reshape should be split into helper functions given its size. - Add helper function for preparing reshape on external metadata. - Close cfd file descriptor. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com> Acked-by: Coly Li <colyli@suse.de> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2022-08-23mdadm: Don't open md device for CREATE and ASSEMBLELogan Gunthorpe3-20/+33
The mdadm command tries to open the md device for most modes, first thing, no matter what. When running to create or assemble an array, in most cases, the md device will not exist, the open call will fail and everything will proceed correctly. However, when running tests, a create or assembly command may be run shortly after stopping an array and the old md device file may still be around. Then, if create_on_open is set in the kernel, a new md device will be created when mdadm does its initial open. When mdadm gets around to creating the new device with the new_array parameter it issues this error: mdadm: Fail to create md0 when using /sys/module/md_mod/parameters/new_array, fallback to creation via node This is because an mddev was already created by the kernel with the earlier open() call and thus the new one being created will fail with EEXIST. The mdadm command will still successfully be created due to falling back to the node creation method. However, the error message itself will fail any test that's running it. This issue is a race condition that is very rare, but a recent change in the kernel caused this to happen more frequently: about 1 in 50 times. To fix this, don't bother trying to open the md device for CREATE, ASSEMBLE and BUILD commands, as the file descriptor will never be used anyway even if it is successfully openned. The mdfd has not been used for these commands since: 7f91af49ad09 ("Delay creation of array devices for assemble/build/create") The checks that were done on the open device can be changed to being done with stat. Side note: it would be nice to disable create_on_open as well to help solve this, but it seems the work for this was never finished. By default, mdadm will create using the old node interface when a name is specified unless the user specifically puts names=yes in a config file, which doesn't seem to be common or desirable to require this.. Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2022-08-23mdadm: move data_offset to struct shapeMariusz Tkaczyk4-26/+22
Data offset is a shape property so move it there to remove additional parameter from some functions. Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2022-08-23mdadm: remove symlink optionMariusz Tkaczyk6-53/+1
The option is not used. Remove it from code. Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>