Patent ID: 7880994

Claim:
A data storage device, comprising: a shock sensor for detecting vibration of the device; a head which reads and writes data from/to a rotating storage medium; an actuator which positions the head on a desired track of the storage medium; a buffer memory which stores at least write data from a host; and a control circuit which receives a write command and write data from the host, writes the write data in a ring buffer of the buffer memory, reports write completion to the host, and writes the write data in the ring buffer to the storage medium in use of the head, wherein the control circuit (a) judges whether the received write command is in a sequential relationship with a write command issued immediately before, the received write command specifying a write area that is continuous from a write area specified by the write command issued immediately before in the sequential relationship, (b) judges whether vibration has been detected in a past based on a vibration detection history of the shock sensor, (c) judges whether the vibration has been detected within a time period between a time of the judgment and a predetermined time in the past when it is judges that the received write command is in the sequential relationship, (d) expands a write return area in the ring buffer which secures one or more track area when the vibration has been detected within the time period in the past (e) detects a write error which has occurred during writing the write data to the storage medium, and (f) executes retry write of the write data for one or more tracks before the write error generated location, in use of the ring buffer.