- last if ($stat->{len} == $stat->{offset});
- if ($old_len == $stat->{offset}) {
- if ($maxwait && $count > $maxwait) {
- # if writes to disk occurs the disk needs to be freezed
- # to be able to complete the migration
+ if ($stat->{len} == $stat->{offset}) {
+ last if $busy eq 'false';
+ if ($count > $maxwait) {
+ # if too much writes to disk occurs at the end of migration
+ #the disk needs to be freezed to be able to complete the migration