This application is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2008-121885, filed on May 8, 2008, the entire contents of which are incorporated herein by reference.
The present invention relates to a recovery function of a storage apparatus.
Conventionally, when an error occurred in an access to a storage area of a storage apparatus such as a magnetic disk drive, the storage apparatus would recover data in the error-occurring storage area (error area) by retry processing of attempting the access once again. The retry processing will be described with reference to the drawings.
The conventional magnetic disk drive 9 illustrated in
The conventional magnetic disk drive 9 thus accesses an error area while changing the accessing conditions depending on the number of retries.
According to the retry processing described above, the time for accessing an error area (the processing time in
According to an aspect of the invention, there is provided a storage apparatus for storing data in a storage area, including: a detection unit that detects a recovery unit area in the storage area, the recovery unit area being a unit area recoverable by retrying; an association unit that associates a unit area out of recovery unit areas detected by the detection unit, the unit area requiring a predetermined time or longer for recovery by retrying, with a recovery parameter which is a retry parameter out of a group of a plurality of retry parameters which are ordered as correction values pertaining to the retrying, the recovery parameter making recovery possible of the unit area that requires the predetermined time or longer for recovery by the retrying; and a retry start unit that starts retrying to recover the unit area that requires the predetermined time or longer for recovery by the retrying, based on a retry parameter of order determined by subtracting a predetermined number from the order of the recovery parameter associated by the association unit with the unit area that requires the predetermined time or longer for recovery by the retrying.
There is also provided a medium containing a retry program in a computer-readable fashion, the retry program being executable by a computer in a storage apparatus for storing data in a storage area, the retry program causing the computer to execute: detecting a recovery unit area in the storage area, the recovery unit area being a unit area recoverable by retrying; associating a unit area out of recovery unit areas detected in the detection, the unit area requiring a predetermined time or longer for recovery by retrying, with a recovery parameter which is a retry parameter out of a group of a plurality of retry parameters which are ordered as correction values pertaining to the retrying, the recovery parameter making recovery possible of the unit area that requires the predetermined time or longer for recovery by the retrying; and starting retrying to recover the unit area that requires the predetermined time or longer for recovery by the retrying, based on a retry parameter of order determined by subtracting a predetermined number from the order of the recovery parameter associated by the association with the unit area that requires the predetermined time or longer for recovery by the retry.
There is also provided a retry method of a storage apparatus for storing data in a storage area, the retry method including: detecting a recovery unit area in the storage area, the recovery unit area being a unit area recoverable by retrying; associating a unit area out of recovery unit areas detected in the detection, the unit area requiring a predetermined time or longer for recovery by retrying, with a recovery parameter which is a retry parameter out of a group of a plurality of retry parameters which are ordered as correction values pertaining to the retrying, the recovery parameter making recovery possible of the unit area that requires the predetermined time or longer for recovery by the retrying; and starting retrying to recover the unit area that requires the predetermined time or longer for recovery by the retrying, based on a retry parameter of order determined by subtracting a predetermined number from the order of the recovery parameter associated by the association with the unit area that requires the predetermined time or longer for recovery by the retrying.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention, as claimed.
Hereinafter, an embodiment of the present invention will be described with reference to the drawings. It should be appreciated that while the present embodiment will deal with a magnetic disk drive (HDD) as an example of the storage apparatus, it is not intended to limit the aspect of the invention.
Description will initially be given of the HDD (Hard Disk Drive) according to the present embodiment.
As illustrated in
The host IF control unit 2 is a control circuit for controlling a host interface which is not illustrated in
As illustrated in
Now, the operation of the HDD according to the present embodiment will be described.
Initially, the MPU 9 of the HDD 1 starts scanning the entire storage area of the disk medium 16 by Read Scan (S101, detection step). Having started scanning, the MPU 9 determines whether a recoverable area, a data area that can be accessed by retrying, is detected or not (S102, detection step).
If a recoverable area is detected (S102, YES), the MPU 9 performs recovery processing on the recoverable area (S103). In this recovery processing, retries are repeated until the data in the recoverable area (recovery unit area) is accessed. If the data in the recoverable area is accessed by the recovery processing, the MPU 9 determines whether or not the time taken for the recovery processing exceeds a host timeout period (S104, association step).
If the time taken for the recovery processing exceeds the host timeout period (S104, YES), the MPU 9 saves a recovery area number which indicates the recoverable area recovered by the recovery processing and a RetryStep at which the recoverable area is recovered, into the disk medium 16 or the nonvolatile memory 5 in association with each other (S105, association step). Having stored the recovery area number and the time (RetryStep) taken for the recovery processing, the MPU 9 determines whether or not the scanned area is the final area (S106). Note that the RetryStep refers to a parameter or correction value pertaining to retrying (retry parameter, retry content in
If the scanned area is the final area (S106, YES), the MPU 9 ends the processing.
On the other hand, if the scanned area is not the final area (S106, NO), the MPU 9 scans the next area (S107).
At step S104, if the time taken for the recovery processing does not exceed the host timeout period (S104, NO), the MPU 9 determines whether or not the scanned area is the final area (S106).
At step S102, if no recoverable area is detected (S102, NO), the MPU 9 determines whether or not the scanned area is the final area (S106).
By the foregoing operation, the HDD 1 can identify areas where the recovery processing time exceeds the host timeout period. The HDD 1 can also acquire the RetrySteps of the areas where the host timeout period is exceeded, by using Read Scan in SMART Self Test which is one of the functions implemented in the HDD 1. In the following description, an area where the recovery processing time exceeds the host timeout period will be referred to as a hard recovery area.
Next, description will be given of the retry processing. This retry processing is performed when the access target of an access command is a recovery area.
Initially, the MPU 9 determines whether or not the access area the access command is targeted on is a recovery area (S201).
If the access area is a recovery area (S201, YES), the MPU 9 determines whether or not the access area is a hard recovery area (S202, retry start step).
If the access area is a hard recovery area (S202, YES), the MPU 9 performs quick retry processing to be described later (S203, retry start step).
On the other hand, if the access area is not a hard recovery area (S202, NO), the MPU 9 performs normal retry processing to be described later (S204).
At step S201, if the access area is not a recovery area (S201, NO), the MPU 9 ends the processing.
By the foregoing operation, the HDD 1 can perform different types of retry processing on hard recovery areas where the recovery processing time exceeds the host timeout period and on recovery areas where the recovery processing time does not exceed the host timeout period, respectively.
Next, the normal retry processing will be described.
The MPU 9 initially substitutes 1 to a variable N (S301), where N is the RetryStep such as illustrated in
Next, the MPU 9 determines whether or not the recovery area is recovered (S303).
If the recovery area is not recovered (S303, NO), the MPU 9 determines whether or not a timeout occurs in the retry processing, i.e., the time taken for the retry processing exceeds the host timeout period (S304).
If no timeout occurs in the retry processing (S304, NO), the MPU 9 substitutes RetryStep N+1 into N (S305), and performs the retry processing on the recovery area again with RetryStep N (S302).
On the other hand, if a timeout occurs in the retry processing (S304, YES), the MPU 9 ends the normal retry processing.
At step S303, if the recovery area is recovered (S303, YES), the MPU 9 ends the normal retry processing.
As described above, the normal retry processing executes retry processing from RetryStep 1 until the recovery area is recovered. In contrast, the quick retry processing executes retry processing from a predetermined RetryStep.
As illustrated in
Next, the MPU 9 performs retry processing on the recovery area with RetryStep N (S402, retry start step).
Next, the MPU 9 determines whether or not the recovery area is recovered (S403).
If the recovery area is not recovered (S403, NO), the MPU 9 determines whether or not a timeout occurs in the retry processing, i.e., the time taken for the retry processing exceeds the host timeout period (S404).
If no timeout occurs in the retry processing (S404, NO), the MPU 9 substitutes RetryStep N+1 into N (S405), and performs the retry processing on the recovery area again with RetryStep N (S402).
On the other hand, if a timeout occurs in the retry processing (S404, YES), the MPU 9 ends the quick retry processing.
At step S403, if the recovery area is recovered (S403, YES), the MPU 9 ends the quick retry processing.
As described above, in an area where the time necessary for retry processing exceeds the host timeout period, the retry processing can be started from some steps before the successfully-recovered RetryStep that is stored in advance, thereby avoiding a timeout.
The present invention may be practiced in various other forms without departing from the gist or essential characteristics thereof. The foregoing embodiment is therefore to be considered in all respects as illustrative and not restrictive. The scope of the invention is indicated by the appended claims rather than by the foregoing description. All changes, improvements, substitutions, and modifications which come within the meaning and range of equivalency of the claims are also intended to be embraced in the scope of the invention.
The present invention is also applicable to a computer system such as described below.
A program for causing a computer system including the HDD 1 such as described above to execute the foregoing steps may be provided as a retry program. This program is stored in a recording medium that is readable to the computer system so that it can be transferred from the main unit 100, the host apparatus, to the program memory 11 of the HDD 1 and executed by the HDD 1. The program for executing the foregoing steps may be stored in a portable recording medium such as a disk 910, or may be downloaded from a recording medium 906 of another computer system through the communication device 905. While the present embodiment has dealt with the case where the program memory 11 contains this program in advance, the program may be stored in a computer-readable recording medium such as the disk 910. Recording media readable to the computer system 900 include: internal storage devices which are implemented inside the computer, such as ROM and RAM; portable recording media such as the disk 910, flexible disk, DVD disk, magneto-optical disk, and IC card; databases for storing computer programs, and other computer systems and their databases; and various types of recording media accessible to a computer system that is connected via a communication unit such as the communication device 905.
The present invention provides the effect that timeout errors can be avoided when accessing error areas.
All examples and conditional language recited herein are intended for pedagogical purposes to aid the reader in understanding the invention and the concepts contributed by the inventor to furthering the art, and are to be construed as being without limitation to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although the embodiment(s) of the present inventions have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2008-121885 | May 2008 | JP | national |