const sector_t this_sector = r1_bio->sector;
        int sectors;
        int best_good_sectors;
-       int best_disk, best_dist_disk, best_pending_disk;
+       int best_disk, best_dist_disk, best_pending_disk, sequential_disk;
        int disk;
        sector_t best_dist;
        unsigned int min_pending;
        struct md_rdev *rdev;
        int choose_first;
-       int choose_next_idle;
 
        /*
         * Check if we can balance. We can balance on the whole
        sectors = r1_bio->sectors;
        best_disk = -1;
        best_dist_disk = -1;
+       sequential_disk = -1;
        best_dist = MaxSector;
        best_pending_disk = -1;
        min_pending = UINT_MAX;
        best_good_sectors = 0;
-       choose_next_idle = 0;
        clear_bit(R1BIO_FailFast, &r1_bio->state);
 
        if ((conf->mddev->recovery_cp < this_sector + sectors) ||
                        int opt_iosize = bdev_io_opt(rdev->bdev) >> 9;
                        struct raid1_info *mirror = &conf->mirrors[disk];
 
-                       best_disk = disk;
                        /*
                         * If buffered sequential IO size exceeds optimal
                         * iosize, check if there is idle disk. If yes, choose
                            mirror->next_seq_sect > opt_iosize &&
                            mirror->next_seq_sect - opt_iosize >=
                            mirror->seq_start) {
-                               choose_next_idle = 1;
-                               continue;
+                               /*
+                                * Add 'pending' to avoid choosing this disk if
+                                * there is other idle disk.
+                                */
+                               pending++;
+                               /*
+                                * If there is no other idle disk, this disk
+                                * will be chosen.
+                                */
+                               sequential_disk = disk;
+                       } else {
+                               best_disk = disk;
+                               break;
                        }
-                       break;
                }
 
-               if (choose_next_idle)
-                       continue;
-
                if (min_pending > pending) {
                        min_pending = pending;
                        best_pending_disk = disk;
                }
        }
 
+       /*
+        * sequential IO size exceeds optimal iosize, however, there is no other
+        * idle disk, so choose the sequential disk.
+        */
+       if (best_disk == -1 && min_pending != 0)
+               best_disk = sequential_disk;
+
        /*
         * If all disks are rotational, choose the closest disk. If any disk is
         * non-rotational, choose the disk with less pending request even the