(Online Capacity Expansion for IMSM) The following series implements Online Capacity Expansion in mdadm for Raid0 or Raid5 arrays build on IMSM's metadata. It allows for adding new hard drive(s) to existing IMSM Raid0 or Raid5 array. Online Capacity Expansion for External Metadata requires Takeover functionality in md and mdadm. Algorithm looks as follows: 1. mdadm: For Raid0 array, execute takeover to Raid5 2. mdadm: set new raid disks number to md using raid_disks entry in sysfs 3. mdadm: call update_super() to configure added disks from spares pool (add them to md configuration) and prepare metadata update 4. mdadm: run reshape using sync_action entry in sysfs 5. md : starts reshape 6. mdmon: detects change in md configuration (increases number of disks) 7. mdmon: reallocates active_array structure and external metadata specific structures using grow_array() vector to avoid memory corruption during metadata update processing. 8. mdadm: post metadata update to mdmon (mdmon is ready to receive it) 9. mdmon: process metadata update and calculate new array size. Store new array size with metadata update on disks. ... reshape ... 10. md : finishes reshape, array size is not increased by md as it is managed externally 11.mdmon: finishes migration in metadata 12.mdadm: reads array size from metadata and sets it to md 13.mdadm: For Raid0 array, execute takeover from Raid5 to Raid0 For IMSM, it is required to expand all arrays in container at time, so reshape has to be run on container and it is changed to serial execution for every array in container. Feature is treated as experimental due to Windows compatibility during reshape process, so last patch puts check to the code for EXPERIMENTAL compilation flag usage. To use this feature 2 steps are required: 1. Add spares to container i.e. mdadm –add /dev/md/imsm_container_name /dev/sdX For Raid0 spares are required also. Patch "[PATCH 17/23] Add spares to raid0 array using takeover" enables this. 2. Execute reshape i.e. : mdadm –grown /dev/md/imsm_container_name –raid-devices=requested_raid_disks_number –backup-file=patch_to_backup_file Grow is executed for all arrays in container that command is executed on. --- Adam Kwolek (23): imsm: Treat expansion as experimental feature imsm: Add start limitation for container imsm: Run Online Capacity Expansion on container Finalize raid0 array expansion Expand raid0 array using takeover FIX: Raid0 takeover has to start monitoring Raid5 Add spares to raid0 array using takeover Set size on reshape finish by mdadm imsm: Set new array size in update_grow_array imsm: Add support for finalize expansion in end_migration() imsm: Add support for finalize expansion in imsm_set_disk() imsm: Finalize reshape after adding disks to array Finalize reshape after adding disks to array imsm: FIX: core during imsm metadata writing imsm: update metadata implementation for update_grow_array imsm: FIX: crash on online capacity expansion start Disable rebuild during Online Capacity Expansion imsm: FIX: crash during reshape on recovery start update imsm: Reconfigure mdmon, grow_array() implementation Reconfigure mdmon on reshape start when disks number grows imsm: update_super() implementation for adding disks fix: mdadm memory corruption Add Online Capacity Expansion to mdadm for external metadata Grow.c | 642 ++++++++++++++++++++++++++++++++++++++++++++++- Manage.c | 144 +++++++++++ managemon.c | 27 ++ mdadm.c | 2 mdadm.h | 39 +++ mdmon.h | 2 monitor.c | 76 ++---- super-intel.c | 771 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- sysfs.c | 142 ++++++++++ util.c | 95 +++++++ 10 files changed, 1842 insertions(+), 98 deletions(-) -- Signature ��.n��������+%������w��{.n�����{����w��ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f