xfs
[Top] [All Lists]

Re: Clarification about NULLs in the file after a crash

To: Lachlan McIlroy <lachlan@xxxxxxx>
Subject: Re: Clarification about NULLs in the file after a crash
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Fri, 26 Sep 2008 17:11:28 +1000
Cc: pvlogin@xxxxxxxxx, xfs@xxxxxxxxxxx
In-reply-to: <48DC770D.1000308@xxxxxxx>
Mail-followup-to: Lachlan McIlroy <lachlan@xxxxxxx>, pvlogin@xxxxxxxxx, xfs@xxxxxxxxxxx
References: <607544.16970.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <48DC770D.1000308@xxxxxxx>
User-agent: Mutt/1.5.18 (2008-05-17)
On Fri, Sep 26, 2008 at 03:45:49PM +1000, Lachlan McIlroy wrote:
> p v wrote:
>> Let's say that I did lseek/writev 10x - if I crash
>> after that according to the FAQ I can get NULLs in the file
>> - but - can I get it only at the end of the file or is it
>> possible to get NULLs in the middle as well? I could modify
>> my application to recover if it was only at the end
>> (ftruncate up to the last initialized data in the file) but
>> I cannot traverse the whole file and I don't want to
>> create checkpoints by doing fdatasync from time to time (at
>> that point I would consider to go up to the fixed version of
>> xfs).
> Good question.  I think you could get gaps of NULLs in the start
> or middle of the file if the VM flushed data from the middle or
> end of the file first and then the inode was updated on disk.
> Since data at the start of the file has not been written out
> yet then no extents may have been allocated there yet either.
>
> That's just a guess though - I don't know if it could actually
> happen that way.

Yes, you can certainly still get NULLs in the middle of the file.
It just depends on the timing and writeback patterns. if you are
in low memory conditions, the VM will do random page writeback
which means that there is no guarantee which page gets written
first....

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>