Skip to content

Commit

Permalink
ataflop: switch from req->errors to req->error_count
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Apr 20, 2017
1 parent 4590879 commit c8e9078
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions drivers/block/ataflop.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,12 +617,12 @@ static void fd_error( void )
if (!fd_request)
return;

fd_request->errors++;
if (fd_request->errors >= MAX_ERRORS) {
fd_request->error_count++;
if (fd_request->error_count >= MAX_ERRORS) {
printk(KERN_ERR "fd%d: too many errors.\n", SelectedDrive );
fd_end_request_cur(-EIO);
}
else if (fd_request->errors == RECALIBRATE_ERRORS) {
else if (fd_request->error_count == RECALIBRATE_ERRORS) {
printk(KERN_WARNING "fd%d: recalibrating\n", SelectedDrive );
if (SelectedDrive != -1)
SUD.track = -1;
Expand Down Expand Up @@ -1386,7 +1386,7 @@ static void setup_req_params( int drive )
ReqData = ReqBuffer + 512 * ReqCnt;

if (UseTrackbuffer)
read_track = (ReqCmd == READ && fd_request->errors == 0);
read_track = (ReqCmd == READ && fd_request->error_count == 0);
else
read_track = 0;

Expand All @@ -1409,8 +1409,10 @@ static struct request *set_next_request(void)
fdc_queue = 0;
if (q) {
rq = blk_fetch_request(q);
if (rq)
if (rq) {
rq->error_count = 0;
break;
}
}
} while (fdc_queue != old_pos);

Expand Down

0 comments on commit c8e9078

Please sign in to comment.