NetBSD-Bugs archive

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

Re: kern/38643: [dM] st tape drive loses data



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

From: David Holland <dholland-bugs%netbsd.org@localhost>
To: Havard Eidnes <he%NetBSD.org@localhost>
Cc: gnats-bugs%NetBSD.org@localhost, mouse%Rodents.Montreal.QC.CA@localhost,
        kern-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
        netbsd-bugs%netbsd.org@localhost, yamt%NetBSD.org@localhost
Subject: Re: kern/38643: [dM] st tape drive loses data
Date: Mon, 1 Sep 2008 18:41:36 +0000

 On Mon, Sep 01, 2008 at 08:06:58PM +0200, Havard Eidnes wrote:
  > I don't have any suggestions for a fix, but I may have an
  > observation (which I'm sure you've thought of yourself as well,
  > but it's good to have it written down anyway).
 
 I think I've found the problem, and if so this is the fix:
 
 Index: st.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/scsipi/st.c,v
 retrieving revision 1.205
 diff -u -p -r1.205 st.c
 --- st.c       8 Jun 2008 18:18:34 -0000       1.205
 +++ st.c       1 Sep 2008 18:24:12 -0000
 @@ -1125,7 +1125,7 @@ done:
        /*
         * Correctly set the buf to indicate a completed xfer
         */
 -      bp->b_resid = bp->b_bcount;
 +      bp->b_resid = 0;
        biodone(bp);
        return;
  }
 
 This has been this way ~forever, and AFAIK it's always been wrong, but
 changes in kern_physio before 4.0 have changed the resulting behavior
 so that it could easily be consistent with the observed phenomena.
 
 There's also another maybe related issue: line 413 of kern_physio.c
 1.87 has
        /* uio->uio_offset = ps->ps_endoffset; */
 
 which yamt added, commented out, when cleaning up some grossness prior
 to 4.0. I am pretty sure it's why part of the data is getting skipped
 over, and I think it should be uncommented. yamt?
 
 On the other hand, I could be completely wrong here too...
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index