[Hardware] SCSI RAID

Sergey Vlasov vsu на altlinux.ru
Пт Июн 1 18:14:54 MSD 2007

On Fri, Jun 01, 2007 at 04:29:34PM +0300, Michael Shigorin wrote:
> > Поплакался и ладно...  Т.е. эта фича XFS неотключаема?
> Боюсь, да.  Сам вот надеюсь, что всё-таки сделают рубильник.

В самых свежих ядрах приделали следующее:

    [XFS] Fix to prevent the notorious 'NULL files' problem after a crash.
    The problem that has been addressed is that of synchronising updates of
    the file size with writes that extend a file. Without the fix the update
    of a file's size, as a result of a write beyond eof, is independent of
    when the cached data is flushed to disk. Often the file size update would
    be written to the filesystem log before the data is flushed to disk. When
    a system crashes between these two events and the filesystem log is
    replayed on mount the file's size will be set but since the contents never
    made it to disk the file is full of holes. If some of the cached data was
    flushed to disk then it may just be a section of the file at the end that
    has holes.
    There are existing fixes to help alleviate this problem, particularly in
    the case where a file has been truncated, that force cached data to be
    flushed to disk when the file is closed. If the system crashes while the
    file(s) are still open then this flushing will never occur.
    The fix that we have implemented is to introduce a second file size,
    called the in-memory file size, that represents the current file size as
    viewed by the user. The existing file size, called the on-disk file size,
    is the one that get's written to the filesystem log and we only update it
    when it is safe to do so. When we write to a file beyond eof we only
    update the in- memory file size in the write operation. Later when the I/O
    operation, that flushes the cached data to disk completes, an I/O
    completion routine will update the on-disk file size. The on-disk file
    size will be updated to the maximum offset of the I/O or to the value of
    the in-memory file size if the I/O includes eof.

Т.е., вместо файлов, заполненных нулевыми байтами, в случае сбоя будут
появляться файлы урезанного размера, поскольку поле размера файла на
диске будет обновляться только после фактической записи данных на
диск.  (Хотя я не уверен, что нули не появятся в случае, если по
каким-то причинам блоки будут записываться на диск не в том порядке, в
котором они находятся в файле - впрочем, это маловероятно.)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.altlinux.org/pipermail/hardware/attachments/20070601/b341e6ed/attachment.bin 

Подробная информация о списке рассылки Hardware