Patent ID: 7774510

Claim:
A method for handling input/output (I/O) commands in a storage system, the storage system including an I/O command queue, and the storage system receiving I/O commands, wherein an I/O command is placed in the queue when received and is removed from the queue when finished, and wherein an I/O timeout value is established and an I/O is considered to have a problem if the I/O does not finish within the I/O timeout value, the method comprising: establishing a first counter for counting unfinished I/O commands; establishing a second counter for counting unfinished I/O commands; establishing a reference, and initially setting the reference to the first counter; periodically switching the reference between the first counter and the second counter, the switching taking place such that a switching interval is less than the I/O timeout value; wherein, upon placing the I/O command into the queue, a copy of the current reference is made into an I/O specific control block and the current referenced counter is incremented; wherein, upon finishing of the I/O command, the counter referenced by the I/O specific control block is decremented; wherein, when switching the reference, the problem is detected in the event that the counter being switched to is above a predetermined threshold; and upon detection of the problem, conducting a more explicit I/O check.