diff options
author | Xiao Ni <xni@redhat.com> | 2024-09-11 10:54:26 +0200 |
---|---|---|
committer | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2024-09-23 10:48:42 +0200 |
commit | 166e5e2fc4b634df100ccc0010035f925bb2ad63 (patch) | |
tree | b088711423ee73903036dba7fd2fb6cfa61f69c5 | |
parent | mdadm/Grow: Can't open raid when running --grow --continue (diff) | |
download | mdadm-166e5e2fc4b634df100ccc0010035f925bb2ad63.tar.xz mdadm-166e5e2fc4b634df100ccc0010035f925bb2ad63.zip |
mdadm/Grow: sleep a while after removing disk in impose_level
It needs to remove disks when reshaping from raid456 to raid0. In
kernel space it sets MD_RECOVERY_RUNNING. And it will fail to change
level. So wait sometime to let md thread to clear this flag.
This is found by test case 05r6tor0.
Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
-rw-r--r-- | Grow.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -3034,6 +3034,13 @@ static int impose_level(int fd, int level, char *devname, int verbose) makedev(disk.major, disk.minor)); hot_remove_disk(fd, makedev(disk.major, disk.minor), 1); } + /* + * hot_remove_disk lets kernel set MD_RECOVERY_RUNNING + * and it can't set level. It needs to wait sometime + * to let md thread to clear the flag. + */ + pr_info("wait 5 seconds to give kernel space to finish job\n"); + sleep_for(5, 0, true); } c = map_num(pers, level); if (c) { |