ignore out-of-range addresses on low-level format commands (s4diag formats once sector past the end of each track)

Thu, 17 Apr 2014 01:50:41 -0600

author
andrew@localhost
date
Thu, 17 Apr 2014 01:50:41 -0600
changeset 148
b0eac383e342
parent 147
ad888290cdff
child 149
1124f0f5409d

ignore out-of-range addresses on low-level format commands (s4diag formats once sector past the end of each track)

src/wd2010.c file | annotate | diff | revisions
     1.1 diff -r ad888290cdff -r b0eac383e342 src/wd2010.c
     1.2 --- a/src/wd2010.c	Wed Apr 16 02:20:43 2014 -0600
     1.3 +++ b/src/wd2010.c	Thu Apr 17 01:50:41 2014 -0600
     1.4 @@ -349,7 +349,7 @@
     1.5  							// Read Sector
     1.6  
     1.7  							// Check to see if the cyl, hd and sec are valid
     1.8 -							if ((ctx->track > (ctx->geom_tracks-1)) || (ctx->head > (ctx->geom_heads-1)) || ((ctx->sector + ctx->sector_count - 1) > ctx->geom_spt-1)) {
     1.9 +							if (cmd != CMD_WRITE_FORMAT && ((ctx->track > (ctx->geom_tracks-1)) || (ctx->head > (ctx->geom_heads-1)) || ((ctx->sector + ctx->sector_count - 1) > ctx->geom_spt-1))) {
    1.10  								LOG("*** WD2010 ALERT: CHS parameter limit exceeded! CHS=%d:%d:%d, nSecs=%d, endSec=%d maxCHS=%d:%d:%d",
    1.11  										ctx->track, ctx->head, ctx->sector,
    1.12  										ctx->sector_count,