Data error detection during media write

Data error detection comprises storing in a first buffer data to be written to a medium and a first digital signature of the data. If the first digital signature matches a second digital signature of data read from the first buffer, a compressed form of data read from the first buffer is stored in a FIFO. If the first digital signature matches a third digital signature of an uncompressed form of the compressed data, the uncompressed form of the compressed data, a C2 ECC of a first C1 ECC of the uncompressed form of the compressed data, and one or more C1 ECCs comprising the first C1 ECC and a second C1 ECC of the C2 ECC are stored in a second buffer. Success is indicated if the one or more C1 ECCs match corresponding C1 ECCs calculated from data and C1 ECCs read from the second buffer, and if a C1 ECC of the data read from the second buffer and written to a medium matches a C1 ECC of corresponding data read back from the medium.

FIELD OF THE INVENTION

The present invention relates to the field of computer science. More particularly, the present invention relates to data error detection during media write.

BACKGROUND OF THE INVENTION

In the field of magnetic tape recording, tape medium recording mechanisms typically do not detect data errors that occur during the various stages of preparing data to be recorded on a tape medium. Two of these stages are data processing and ECC parity generation. Hence, if errors occur during one or more of these stages, when a subsequent attempt is made to recover data from the tape medium, the recovered data is typically either found to be corrupt, or the errors remain undetected. If the recovered data is found to be corrupt, no data is returned to the host that requested data recovery. And if the errors remain undetected, incorrect data is returned to the host.

Accordingly, a need exists in the art for solution that provides improved data error detection for errors that occur during the various stages of preparing data to be recorded on a tape medium.

SUMMARY OF THE INVENTION

Data error detection comprises storing in a first buffer data to be written to a medium and a first digital signature of the data. If the first digital signature matches a second digital signature of data read from the first buffer, a compressed form of data read from the first buffer is stored in a FIFO. If the first digital signature matches a third digital signature of an uncompressed form of the compressed data, the uncompressed form of the compressed data, a C2 ECC of a first C1 ECC of the uncompressed form of the compressed data, and one or more C1 ECCs comprising the first C1 ECC and a second C1 ECC of the C2 ECC are stored in a second buffer. Success is indicated if the one or more C1 ECCs match corresponding C1 ECCs calculated from data and C1 ECCs read from the second buffer, and if a C1 ECC of the data read from the second buffer and written to a medium matches a C1 ECC of corresponding data read back from the medium.

DETAILED DESCRIPTION

In accordance with one embodiment of the present invention, the components, process steps, and/or data structures may be implemented using various types of operating systems (OS), computing platforms, firmware, computer programs, computer languages, and/or general-purpose machines. The method can be run as a programmed process running on processing circuitry. The processing circuitry can take the form of numerous combinations of processors and operating systems, or a stand-alone device. The process can be implemented as instructions executed by such hardware, hardware alone, or any combination thereof. The software may be stored on a program storage device readable by a machine.

In addition, those of ordinary skill in the art will recognize that devices of a less general purpose nature, such as hardwired devices, field programmable logic devices (FPLDs), comprising field programmable gate arrays (FPGAs) and complex programmable logic devices (CPLDs), application specific integrated circuits (ASICs), or the like, may also be used without departing from the scope and spirit of the inventive concepts disclosed herein.

In accordance with one embodiment of the present invention, the method may be implemented on a data processing computer such as a personal computer, workstation computer, mainframe computer, or high performance server running an OS such as Solaris® available from Sun Microsystems, Inc. of Santa Clara, Calif., Microsoft® Windows® XP and Windows® 2000, available from Microsoft Corporation of Redmond, Wash., or various versions of the Unix operating system such as Linux available from a number of vendors. The method may also be implemented on a mobile device running an OS such as Windows® CE, available from Microsoft Corporation of Redmond, Wash., Symbian OS™, available from Symbian Ltd of London, UK, Palm OS®, available from PalmSource, Inc. of Sunnyvale, Calif., and various embedded Linux operating systems. Embedded Linux operating systems are available from vendors including MontaVista Software, Inc. of Sunnyvale, Calif., and FSMLabs, Inc. of Socorro, N.M. The method may also be implemented on a multiple-processor system, or in a computing environment comprising various peripherals such as input devices, output devices, displays, pointing devices, memories, storage devices, media interfaces for transferring data to and from the processor(s), and the like. In addition, such a computer system or computing environment may be networked locally, or over the Internet.

In the context of the present invention, the term “network” comprises local area networks, wide area networks, the Internet, cable television systems, telephone systems, wireless telecommunications systems, fiber optic networks, ATM networks, frame relay networks, satellite communications systems, and the like. Such networks are well known in the art and consequently are not further described here.

In the context of the present invention, the term “digital signature” describes digital representation of the result of applying an algorithm for detecting one or more errors in a stored or transmitted sequence of bytes. A digital signature may comprise, by way of example, a cyclic redundancy check (CRC), a checksum, or a hash code.

In the context of the present invention, the term “Error Correction Code” (ECC) describes digital representation of the result of applying an algorithm for detecting and correcting one or more errors in a stored or transmitted sequence of bytes.

In the context of the present invention, the term “first-in-first-out” (FIFO) describes a storage mechanism in which the data stored for the longest time is retrieved first. A FIFO may be implemented in hardware, software, firmware, or a combination thereof.

FIG. 1depicts a block diagram of a computer system100suitable for implementing aspects of the present invention. As shown inFIG. 1, computer system100comprises a bus102which interconnects major subsystems such as a central processor104, a system memory106(typically RAM), an input/output (I/O) controller108, an external device such as a display screen110via display adapter112, serial ports114and116, a keyboard118, a fixed disk drive120, a floppy disk drive122operative to receive a floppy disk124, a CD-ROM player126operative to receive a CD-ROM128, and a tape drive138operative to receive tape media140. Many other devices can be connected, such as a pointing device130(e.g., a mouse) connected via serial port114and a modem132connected via serial port116. Modem132may provide a direct connection to a remote server via a telephone link or to the Internet via a POP (point of presence). Alternatively, a network interface adapter134may be used to interface to a local or wide area network using any wired or wireless network interface system known to those skilled in the art (e.g., Infiniband, Ethernet, xDSL, AppleTalk™, IEEE 802.11, and Bluetooth®).

Many other devices or subsystems (not shown) may be connected in a similar manner. Also, it is not necessary for all of the devices shown inFIG. 1to be present to practice the present invention, as discussed below. Furthermore, the devices and subsystems may be interconnected in different ways from that shown inFIG. 1. The operation of a computer system such as that shown inFIG. 1is readily known in the art and is not discussed in detail in this application, so as not to overcomplicate the present discussion. Code to implement the present invention may be operably disposed in system memory106or stored on storage media such as fixed disk120, floppy disk124, CD-ROM128, thumbdrive136, or tape media140.

Turning now toFIG. 2, a block diagram that illustrates an apparatus for data error detection during media write, in accordance with one embodiment of the present invention is presented. As shown inFIG. 2, medium storage device294comprises a data processor200, a host data interface292, a medium formatter220, a C2 ECC generator242, a first buffer238, and a second buffer240.

Host data interface292is adapted to receive data from a host, i.e. a computer system100controlled by central processor104as depicted inFIG. 1, and store both the received data and a digital signature of the received data in a first buffer238. According to one embodiment of the present invention, host data interface292comprises a direct memory access (DMA) interface.

Data processor200is adapted to receive data from first buffer238and use record-level digital signature checks to detect errors in data read from the first buffer238, or that result from application of a data compression algorithm. Data processor200is further adapted to store in a second buffer240the data (284,282,278,276,274,272,270), a C1 ECC of the data (250,254,256,260), and a C1 ECC of C2 ECC data (264,266). According to one embodiment of the present invention, the data (250,254,256,260) plus C1 ECC (250,254,256,260,264,266) is organized in rows of memory locations in the second buffer240.

Data processor200comprises a digital signature checker202, a data compressor204, a data decompressor212, a FIFO208, and a C1 ECC Generator218. Digital signature checker202is adapted to receive the data286and digital signature280from the first buffer238and calculate a second digital signature of the data read from the first buffer238. Digital signature checker202is further adapted to, if the first digital signature matches the second digital signature, compress data from the first buffer238, store the compressed data in a FIFO208, uncompress the data stored in the FIFO208, and calculate a third digital signature of the uncompressed data from the FIFO208. If the first digital signature and the second digital signature do not match, or if the first digital signature and the third digital signature do not match, an error is indicated.

Still referring toFIG. 2, C1 ECC generator218is adapted to receive data from FIFO208, calculate the C1 ECC of data from the FIFO208, store data from the FIFO208and the calculated E1 ECC in the second buffer240, and calculate and store the C1 ECC of the C2 ECC.

C2 ECC generator242is adapted to calculate the C2 ECC of the C1 ECC and store it in the second buffer204. According to one embodiment of the present invention, data processor200comprises C2 ECC generator242. According to another embodiment of the present invention, medium formatter220comprises C2 ECC generator242.

Medium formatter220comprises a C1 ECC checker226, a writer228, a C1 ECC checker230, and a reader232. C1 ECC checker226is adapted to receive data, C2 ECCs, and C1 ECCs from the second buffer240, and to calculate C1 ECC of data and C2 ECCs. Medium formatter220is further adapted to determine whether the calculated C1 ECCs match the C1 ECCs read from the second buffer240. Medium formatter220is further adapted to indicate an error if no match is found. Medium formatter is further adapted to, if there is a match, write data to the medium, read the data back from the medium, and calculate the C1 ECC of the data read back from the medium. Medium formatter220is further adapted to indicate an error if the calculated C1 ECC does not match the C1 ECC calculated before the data was written to the medium.

Many other devices or subsystems (not shown) may be connected in a similar manner. Also, it is not necessary for all of the devices shown inFIG. 2to be present to practice the present invention, as discussed below. Furthermore, the devices and subsystems may be interconnected in different ways from that shown inFIG. 2.

According to one embodiment of the present invention, a medium comprises a serial medium. According to another embodiment of the present invention, a medium comprises a serial tape medium. According to another embodiment of the present invention, a medium comprises a serial magnetic tape medium.

According to another embodiment of the present invention, one or more of first buffer238, second buffer240, and FIFO208comprise separate portions of a single memory.

Turning now toFIG. 3, a high-level flow diagram that illustrates a method for data error detection during media write, in accordance with one embodiment of the present invention is presented. The processes illustrated inFIG. 3may be performed by medium storage device294ofFIG. 2. Furthermore, the processes illustrated inFIG. 3may be implemented in hardware, software, firmware, or a combination thereof. At300, data to be written to a medium and a first digital signature of the data are stored in a first buffer. At305, a determination is made regarding whether the first digital signature matches a second digital signature of data read from the first buffer. If there is no match, an error is indicated at350. If there is a match, at310the data from the first buffer is compressed and stored in a FIFO. At315, a determination is made regarding whether the first digital signature matches a third digital signature of data read back from the FIFO and uncompressed. If there is no match, an error is indicated at350. If there is a match, at320the following are stored in a second buffer: the C1 ECC of data read from the FIFO, the C2 ECC of the C1 ECC, and the C1 ECC of the C2 ECC. At325, the C1 ECC of the data and the C2 ECCs read from the second buffer are calculated. At330, a determination is made regarding whether the calculated C1 ECC matches the C1 ECC read from the second buffer. If there is no match, an error is indicated at350. If there is a match, processing of the next data to be written to a medium may continue at300.

Turning now toFIG. 4, a low-level flow diagram that illustrates a method for data error detection during media write, in accordance with one embodiment of the present invention is presented.FIG. 4provides more detail forFIG. 3. The processes illustrated inFIG. 4may be performed by medium storage device294ofFIG. 2. Furthermore, the processes illustrated inFIG. 4may be implemented in hardware, software, firmware, or a combination thereof. At400, data to be written to a medium is received. At402, a first digital signature of the received data is calculated. At404, the received data and the first digital signature are stored in a first buffer.

Still referring toFIG. 4, at406, data and the first digital signature are received from the first buffer. At408, a second digital signature of data from the first buffer is calculated. At410, a determination is made regarding whether the second digital signature matches the first digital signature. If there is no match, an error is indicated at446. If there is a match, data from the first buffer is compressed at412. At414, the compressed data is stored in a FIFO. At416, the data stored in the FIFO is uncompressed. At418, a third digital signature of the uncompressed data is calculated. At420, a determination is made regarding whether the third digital signature matches the first digital signature. If there is no match, an error is indicated at446. If there is a match, processing continues at442.

Still referring toFIG. 4, at422, data from the FIFO is received. At424, the C1 ECC of data read from the FIFO is calculated. At426, the data from the FIFO and the C1 ECC are stored in a second buffer. At428, the C2 ECC of the C1 ECC is calculated and then stored in the second buffer. At430, the C1 ECC of the C2 ECC is calculated and then stored in the second buffer.

Still referring toFIG. 4, at432, data, C2 ECCs, and C1 ECCs are received from the second buffer. At434, the C1 ECC of the data from the second buffer, and the C2 ECCs, are calculated. At436, a determination is made regarding whether the calculated C1 ECC matches the C1 ECC from the second buffer. If there is no match, an error is indicated at448. If there is a match, at438, the data is written to the medium. At440, the data is read back from the medium. At442, the C1 ECC of the data read back from the medium is calculated. At444, a determination is made regarding whether the calculated C1 ECC of the data read back from the medium matches the C1 ECC calculated before the write operation. If there is no match, an error is indicated at448. If there is a match, data has been successfully written to the medium. Processing of the next data continues at400.

As shown above, embodiments of the present invention use linear CRC/ECC codes, so that the C1 of the C2 ECC bytes is the same as the C2 of the C1 ECC bytes. By computing C1 as data is put into the second buffer240, computing C2 across both Data and C1, and then checking C1 of both Data and C2 ECC “rows”, an error is detected if any of the data in the second buffer240is corrupted, or if there was an error in the C2 ECC process.