NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/43169: sys/dev/ata/wd.c doesn't call disk_unbusy in case of errors/retries



The following reply was made to PR kern/43169; it has been noted by GNATS.

From: Matthias Pfaller <leo%marco.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/43169: sys/dev/ata/wd.c doesn't call disk_unbusy in case
 of errors/retries
Date: Thu, 22 Apr 2010 19:04:45 +0200

 This is a multi-part message in MIME format.
 --------------000506070409080104070201
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 I'm running for a couple of days with the attached patch. After 
 readerrors the drive is no longer reported 100% busy.
 
 Matthias
 
 --------------000506070409080104070201
 Content-Type: text/plain;
  name="P.txt"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="P.txt"
 
 Index: wd.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/ata/wd.c,v
 retrieving revision 1.384
 diff -u -u -r1.384 wd.c
 --- wd.c       24 Feb 2010 22:37:57 -0000      1.384
 +++ wd.c       22 Apr 2010 16:55:20 -0000
 @@ -585,6 +585,8 @@
                wd->openings--;
  
                wd->retries = 0;
 +              /* Instrumentation. */
 +              disk_busy(&wd->sc_dk);
                wdstart1(wd, bp);
        }
  }
 @@ -664,6 +666,7 @@
                        /* No memory -- fail the iop. */
                        bp->b_error = ENOMEM;
                        bp->b_resid = bp->b_bcount;
 +                      disk_unbusy(&wd->sc_dk, 0, (bp->b_flags & B_READ));
                        biodone(bp);
                        wd->openings++;
                        return;
 @@ -716,8 +719,6 @@
                wd->sc_wdc_bio.flags |= ATA_LBA;
        if (bp->b_flags & B_READ)
                wd->sc_wdc_bio.flags |= ATA_READ;
 -      /* Instrumentation. */
 -      disk_busy(&wd->sc_dk);
        switch (wd->atabus->ata_bio(wd->drvp, &wd->sc_wdc_bio)) {
        case ATACMD_TRY_AGAIN:
                callout_reset(&wd->sc_restart_ch, hz, wdrestart, wd);
 @@ -943,7 +944,7 @@
        return error;
  }
  
 -/* 
 +/*
   * Caller must hold wd->sc_dk.dk_openlock.
   */
  static int
 @@ -1461,7 +1462,7 @@
  
                return 0;
            }
 -      
 +
        case DIOCSSTRATEGY:
            {
                struct disk_strategy *dks = (void *)addr;
 @@ -1630,7 +1631,7 @@
                err = 0;
                break;
        default:
 -              panic("wddump: unknown error type %d", err); 
 +              panic("wddump: unknown error type %d", err);
        }
        if (err != 0) {
                printf("\n");
 
 --------------000506070409080104070201--
 


Home | Main Index | Thread Index | Old Index