Patent attributes
Methods and apparatuses for data protection against corrupted write operations. In one embodiment, a technique of crash protection uses an atomically updated global transaction indicator to switch a set of data structures from one set of versions to another set. In one embodiment, the storage space for multiple versions of a data structure is allocated at the time the data structure is created on the storage device so that the multiple versions of the data structure can be kept close by. Between two consistent points, some data structures are modified to create new versions without changing the corresponding previous versions; and unmodified data structures are not copied. At a consistent point, the global transaction indicator is updated to indicate a set of consistent versions of the data structures, such as metadata of a file system.