[lkml]   [2002]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Subjectone-line-patch against SCSI-Read-Error-BUG()
    Hi, List

    I think, I found a very simple solution for this annoying BUG().

    Since at least kernel 2.4.16 there is a BUG() in pci.h,
    that crashes the kernel on any attempt to read a SCSI-Sector
    from an erased MO-Medium and on any attempt to read
    a sector from a SCSI-disk, which returns "Read-Error".

    There seems to be a thinko in the corresponding code, which
    does not take into account the case where a SCSI-READ
    does not return any data because of a "sense code: read error"
    or a "sense code: blank sector".

    I simply commented out this BUG() statement (see below)
    and everything worked well from there on. The BUG()
    seems to be inadequate.

    Please could you check if I'm right and apply this change to the
    current kernel? Again I want to stress that in my
    oppinion it is dangerous for the stability of a production
    machine if it crashes on the next SCSI-Read-Error it sees.
    Most SCSI-Hardware today shows very few read errors, but
    please let's not rely on that. That'd be playing vabanque.

    If there are tests to do, I can offer my time and hardware
    (SCSI-MO drives and media with various sector sizes) to
    test and in case to provide stack traces.


    static inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
    int nents, int direction)
    int i;

    if (direction == PCI_DMA_NONE)

    * temporary 2.4 hack
    for (i = 0; i < nents; i++ ) {
    if (sg[i].address && sg[i].page)
    --------> else if (!sg[i].address && !sg[i].page)
    --------> BUG();

    if (sg[i].address)
    sg[i].dma_address = virt_to_bus(sg[i].address);
    sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset;

    return nents;

    | Ralf Oehler
    | GDA - Gesellschaft fuer Digitale _/
    | Archivierungstechnik mbH & CoKG _/
    | Ein Unternehmen der Bechtle AG #/_/_/_/ _/_/_/_/ _/_/_/_/
    | _/ _/ _/ _/ _/
    | E-Mail: _/ _/ _/ _/ _/ _/
    | Tel.: +49 6182-9271-23 _/_/_/_/ _/_/_/#/ _/_/_/#/
    | Fax.: +49 6182-25035 _/
    | Mail: GDA, Bensbruchstraße 11, _/_/_/_/
    | D-63533 Mainhausen
    | HTTP:

    time is a funny concept
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:23    [W:0.024 / U:84.300 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site