Source-Changes-HG archive

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

[src/trunk]: src/sys/lib/libsa Fix read retry error case. Closes kern/8300.



details:   https://anonhg.NetBSD.org/src/rev/b05ff66b87ac
branches:  trunk
changeset: 475968:b05ff66b87ac
user:      ross <ross%NetBSD.org@localhost>
date:      Wed Sep 01 02:32:26 1999 +0000

description:
Fix read retry error case. Closes kern/8300.
While here, add automatic error retry up to 3 times.

diffstat:

 sys/lib/libsa/ustarfs.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (41 lines):

diff -r 4f523178010c -r b05ff66b87ac sys/lib/libsa/ustarfs.c
--- a/sys/lib/libsa/ustarfs.c   Wed Sep 01 00:32:41 1999 +0000
+++ b/sys/lib/libsa/ustarfs.c   Wed Sep 01 02:32:26 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ustarfs.c,v 1.9 1999/06/22 22:44:16 christos Exp $     */
+/*     $NetBSD: ustarfs.c,v 1.10 1999/09/01 02:32:26 ross Exp $        */
 
 /* [Notice revision 2.2]
  * Copyright (c) 1997, 1998 Avalon Computer Systems, Inc.
@@ -176,6 +176,7 @@
        struct open_file *f;
        ustoffs seek2;
 {
+       int i;
        int e = 0;      /* XXX work around gcc warning */
        ustoffs lda;
        char *xferbase;
@@ -205,8 +206,13 @@
 #if !defined(LIBSA_NO_TWIDDLE)
                twiddle();
 #endif
-               e = DEV_STRATEGY(f->f_dev)(f->f_devdata, F_READ, seek2 / 512,
-                       xferrqst, xferbase, &xfercount);
+               for (i = 0; i < 3; ++i) {
+                       e = DEV_STRATEGY(f->f_dev)(f->f_devdata, F_READ,
+                           seek2 / 512, xferrqst, xferbase, &xfercount);
+                       if (e == 0)
+                               break;
+                       printf("@");
+               }
                if (e)
                        break;
                if (xfercount != xferrqst)
@@ -214,6 +220,7 @@
                                (int)xfercount, (int)xferrqst);
                xferrqst -= xfercount;
                xferbase += xfercount;
+               seek2    += xfercount;
        }
        return e;
 }



Home | Main Index | Thread Index | Old Index