RE: Problem in sanei_scsi.c

From: Simon Munton (simon@munton.demon.co.uk)
Date: Tue Aug 22 2000 - 14:17:11 PDT

  • Next message: Stens, Ralph: "AW: AHA1505 on Linux, was Re: Agfa SnapScan 1236S"

    I reported this problem back in May, and Abel Deuring applied my patch to
    CVS - but I've just noticed that it isn't in 1.0.3!

    Simon Munton wrote:
    >
    > Hi,
    >
    > I've found a problem in the issue() function in sanei_scsi.c, that results
    > in the queue in sg filling up, and prevents any more scsi commands being
    > issued until the device is closed.
    >
    > There is a test on line 1690 which can erroneously try to reissue a scsi
    > command:
    > if (rp == fdp->sane_qhead && errno == EAGAIN)
    >
    > The first time through the enclosing while loop, rp == fdp->sane_qhead.
    But
    > if the write() call issuing the command was successful, errno is left
    > unchanged, and if errno happens to contain EAGAIN, then the command is
    > issued again, and again... until the command queue in sg is full.

    Anyway, here's a diff against 1.0.3:

    --- sanei_scsi.c.orig Sat Aug 12 15:54:15 2000
    +++ sanei_scsi.c Tue Aug 22 22:00:43 2000
    @@ -1644,6 +1644,7 @@
           retries = 20;
           while (retries)
             {
    + errno = 0;
     #ifdef SG_IO
               if (sg_version < 30000)
                 {

    Regards

    Simon Munton

    --
    Source code, list archive, and docs: http://www.mostang.com/sane/
    To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
    



    This archive was generated by hypermail 2b29 : Tue Aug 22 2000 - 14:11:01 PDT