gnu-arch-users
[Top][All Lists]
Advanced

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

Re: [Gnu-arch-users] [BUG] Something fishy in vfdbuf_write


From: James Blackwell
Subject: Re: [Gnu-arch-users] [BUG] Something fishy in vfdbuf_write
Date: Wed, 28 Jul 2004 00:39:52 -0400

Jeremy Shaw wrote:

> Good news!
>
> Attached is a very crude patch that seems to make tla work much more
> reliably for us[1]. The patch should be fairly self-explanatory. 
>
> Big thanks to andrew suffield. 
>
> Jeremy Shaw.
>
> [1] To quantify that, the test script used to fail almost every
> time. Now it has run 1635 times (and counting) with out a failure in
> sight.
>
>
> --Multipart_Tue_Jul_27_20:33:59_2004-1
> Content-Type: text/x-diff; type=patch; charset=US-ASCII
> Content-Disposition: attachment; filename="hackerlab.diff"
> Content-Transfer-Encoding: quoted-printable
>
>
>
> --- orig/vu/vfdbuf.c
> +++ mod/vu/vfdbuf.c
> @@ -788,7 +804,11 @@
>                                                 to_write,
>                                                 
> bufs.vfd[fd].sub_handler.closure);
>        if (wrote < 0)
> -     return -1;
> +     {
> +       if ((*errn =3D=3D EAGAIN) || (*errn =3D=3D EINTR))
> +         goto retry_after_short_write;
> +       return -1;
> +     }


> +           if ((*errn =3D=3D EAGAIN) || (*errn =3D=3D EINTR))
> +             continue;
> +           return -1;
> +         }

Two silly ideas:

1. how about inserting a couple usleeps (to the equivilant of 10 ms)?
That way, if you're tighly looped with EAGAINs, the machine isn't brought
down in a heap

2. how about a counter, that if it hits X number of EAGAINs/EINTRs in a
row, still return -1?

-- 
James Blackwell          Try something fun: For the next 24 hours, give
Smile more!              each person you meet a compliment!

GnuPG (ID 06357400) AAE4 8C76 58DA 5902 761D  247A 8A55 DA73 0635 7400




reply via email to

[Prev in Thread] Current Thread [Next in Thread]