On Wed, Jun 14, 2017 at 09:12 -0600, Bob Beck wrote:
>
> > As you all might have gathered by now Amit has jumped the gun
> > but was wrong to do so. His setup is not affected by this change.
> > That was expected so please don't get distracted by this as I'm
> > still looking forward to replies to the original set of changes.
> > beck@?
> >
> > > diff --git sys/kern/vfs_bio.c sys/kern/vfs_bio.c
> > > index 95bc80bc0e6..9316e6e0eb2 100644
> > > --- sys/kern/vfs_bio.c
> > > +++ sys/kern/vfs_bio.c
> > > @@ -534,10 +534,27 @@ bread_cluster_callback(struct buf *bp)
> > > */
> > > buf_fix_mapping(bp, newsize);
> > > bp->b_bcount = newsize;
> > > }
> > >
> > > + /* Invalidate read-ahead buffers if read short */
> > > + if (bp->b_resid > 0) {
> > > + printf("read %ld resid %ld\n", bp->b_bcount, bp->b_resid);
>
> Should the printf actually be here? I'm not thinking this thing
> spewing dmesg like a banshee if we get short reads is really going
> to help anything
>
You're looking at the wrong diff. Please look at the first mail in
the thread. This one was for Amit.
> > > + for (i = 0; xbpp[i] != NULL; i++)
> > > + continue;
> > > + for (i = i - 1; i != 0; i--) {
> > > + if (xbpp[i]->b_bufsize <= bp->b_resid) {
> > > + bp->b_resid -= xbpp[i]->b_bufsize;
> > > + SET(xbpp[i]->b_flags, B_INVAL);
> > > + } else if (bp->b_resid > 0) {
> > > + bp->b_resid = 0;
> > > + SET(xbpp[i]->b_flags, B_INVAL);
> > > + } else
> > > + break;
> > > + }
> > > + }
> > > +
> > > for (i = 1; xbpp[i] != 0; i++) {
> > > if (ISSET(bp->b_flags, B_ERROR))
> > > SET(xbpp[i]->b_flags, B_INVAL | B_ERROR);
> > > biodone(xbpp[i]);
> > > }
> >