On Wed, 27 Jul 2011 13:09:07 +0900 Namhyung Kim [off-list ref] wrote:
NeilBrown [off-list ref] writes:
quoted
If we have seen any write error on a drive, then don't write to
any known-bad blocks on that drive.
If necessary, we divide the write request up into pieces just
like we do for reads, so each piece is either all written or
all not written to any given drive.
Signed-off-by: NeilBrown <redacted>
Reviewed-by: Namhyung Kim <redacted>
and a nit below
quoted
- } else
- r1_bio->bios[i] = NULL;
+ if (is_bad) {
+ int good_sectors = first_bad - r1_bio->sector;
+ if (good_sectors < max_sectors)
+ max_sectors = good_sectors;
+ }
+ }
+ r1_bio->bios[i] = bio;
+ targets++;
Looks like variable 'targets' is not needed anymore.
Thanks. I've removed it.
NeilBrown