On Tuesday 20 July 2004 07:09, Chris Wedgwood wrote:
> sounds like:
>
> old file foo on disk, all safe
>
> new file bar is written metadata on disk, file
> data in ram
>
> [*]
>
> rename bar to foo old file unlinked, new
> file in place but data
> not flushed yet
>
> now, if there was an fsync at [*] it would work just fine
>
What if during journal replaying it would recognize this behaviour, and use
the old file, which is still on-disk (right? I suppose at this point the
metadata only gets written to the journal, unless there's a sync, of course)?
> > So why does this happen? Is it for security reasons? I don't think
> > it's that..
>
> it is
>
Here I meant that XFS wouldn't recover the file data if it wasn't sure that
it's contents were valid, which would be useful in multi-user systems (where
a user could accidentaly see other users' files), but in single-user systems
it doesn't matter. But I guess this isn't the problem.
|