The 'offset' local variable can't be changed inside the loop, so
move it out.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Shaohua Li <shli@fb.com>
        int first_clone;
        int sectors_handled;
        int max_sectors;
+       sector_t offset;
 
        /*
         * Register the new request and wait if the reconstruction
        atomic_set(&r1_bio->behind_remaining, 0);
 
        first_clone = 1;
+
+       offset = r1_bio->sector - bio->bi_iter.bi_sector;
        for (i = 0; i < disks; i++) {
                struct bio *mbio = NULL;
-               sector_t offset;
                if (!r1_bio->bios[i])
                        continue;
 
-               offset = r1_bio->sector - bio->bi_iter.bi_sector;
 
                if (first_clone) {
                        /* do behind I/O ?