摘要 |
A method and a system for detecting and recovering a failure command are provided. The method is used in a native command queuing (NCQ) and at least includes the following steps. In step (a), several commands are executed on a disk simultaneously according to the NCQ. In step (b), whether a request time of the commands is longer than a waiting time is measured: if the request time is not longer than the waiting time, then step (a) is executed. In step (c), one command is chosen. In step (d), whether the chosen command is executed successfully is determined: if the chosen command is executed successfully, then step (f) is executed. In step (e), the chosen command is recovered. In step (f), whether all the commands of the NCQ are chosen is determined: if not all the commands are chosen, then another command is chosen and step (d) is repeated.
|