LWN.net Logo

Encoding sector number with each sector

Encoding sector number with each sector

Posted Dec 26, 2006 0:07 UTC (Tue) by AdamRichter (guest, #11129)
Parent article: The 2006 Linux Filesystems Workshop (Part II)

If disk manufacturers would encode the sector number with every sector
that they write and check it on each read, that would simplify recovery
from misdirected writes, where an attempt to write sector X actually
results in a write to sector Y.

With this change, an attempt subsequently to read sector Y would result
in an error notification rather than returning the data that was intended
for sector X. An attempt to read sector X would still return the old
data in sector X that was supposed to have been overwritten, with no
error notification.

It would not surprise me if disk drives already do this.

The advantage here is that a RAID system can automatically correct sector
Y when it is read, because it will be explicitly notified of the error,
even though sector Y is not know from the I/O logs.

As for sector X, its address is known from the I/O history, so it can be
checked by whatever mechanism would be used to check for the "high flying
writes" problem where the data simply was not written to disk at all.
For example, completion of the write might not be signalled to the
operating system until the head had been moved away, and the data then
reread. As another example, a raid-6 system has multiple parity
sectors and therefore can identify the source of bad data even when no
drive is indicating an error, so it could adopt a policy of checking data
data this way from all sectors being reread for the first time, and,
after power failure, all sectors might start with this status unless
there is some log being stored, or perhaps a non-volatile log might be
used on some other device to allow a more efficient recovery policy.

At least for the examples above, implementing these policies at a virtual
device level like RAID has the advantage of providing the benefit to
essentially all existing disk file systems as well as non-filesystem
users of block devices.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds