> -----Original Message----- > From: NeilBrown [mailto:neilb@xxxxxxx] > Sent: Monday, January 17, 2011 2:37 AM > To: Kwolek, Adam > Cc: linux-raid@xxxxxxxxxxxxxxx; Williams, Dan J; Ciechanowski, Ed; > Neubauer, Wojciech > Subject: Re: [PATCH 5/6] FIX: mdadm hangs during reshape > > On Thu, 13 Jan 2011 15:50:42 +0100 Adam Kwolek <adam.kwolek@xxxxxxxxx> > wrote: > > > During reshape when reshape is finished in md, progress_reshape() > hangs > > on select(). Timeout is introduced to allow for reshape conditions > check. > > > > Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx> > > --- > > > > Grow.c | 5 ++++- > > 1 files changed, 4 insertions(+), 1 deletions(-) > > > > diff --git a/Grow.c b/Grow.c > > index f1a6218..763287b 100644 > > --- a/Grow.c > > +++ b/Grow.c > > @@ -2459,6 +2459,7 @@ int progress_reshape(struct mdinfo *info, > struct reshape *reshape, > > * waiting forever on a dead array > > */ > > char action[20]; > > + struct timeval timeout; > > fd_set rfds; > > if (sysfs_get_str(info, NULL, "sync_action", > > action, 20) <= 0 || > > @@ -2466,7 +2467,9 @@ int progress_reshape(struct mdinfo *info, > struct reshape *reshape, > > break; > > FD_ZERO(&rfds); > > FD_SET(fd, &rfds); > > - select(fd+1, NULL, NULL, &rfds, NULL); > > + timeout.tv_sec = 1; > > + timeout.tv_usec = 0; > > + select(fd+1, NULL, NULL, &rfds, &timeout); > > if (sysfs_fd_get_ll(fd, &completed) < 0) { > > close(fd); > > return -1; > > > > -- > > To unsubscribe from this list: send the line "unsubscribe linux-raid" > in > > the body of a message to majordomo@xxxxxxxxxxxxxxx > > More majordomo info at http://vger.kernel.org/majordomo-info.html > > Putting a timeout in here is definitely the wrong thing to do. > > If you can reproduce the hang, please report the values of > completed, max_progress, wait_point > array: Level: 0 Chunk: 64 Size: 100485 Disks in array: 3 Spare disks: 1 Layout: n/a Configuration: mdadm -C /dev/md/container -amd -e -n3 /dev/sda /dev/sdb /dev/sdc mdadm -C /dev/md/raid0_vol -amd -l 0 --chunk 64 --size 100485 -n3 /dev/sda /dev/sdb /dev/sdc -R mdadm --add /dev/md/container /dev/sdd OLCE command: mdadm --grow /dev/md/container --raid-devices 4 --backup-file=/backup_file.bak mdadm stops at: completed = 0 (possiblet before select() check for this should be added) max_progress == wait_point = 200960 I hope this helps BR Adam > at that time, and the details of the array (level, devices, size, > layout, > chunk size, etc). > > NeilBrown -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html