xfs
[Top] [All Lists]

is rename atomic in XFS, also some sync question?

To: linux-xfs@xxxxxxxxxxx
Subject: is rename atomic in XFS, also some sync question?
From: Olaf Frączyk <olaf@xxxxxxxxxxxxx>
Date: Wed, 08 Dec 2004 11:46:18 +0100
Sender: linux-xfs-bounce@xxxxxxxxxxx
Hi,

I want to atomically change file content.
Will the scenario work?:

1. cp config.oryg config.change
2. do some changes on config.change
3. sync
4. mv config.change config.oryg
5. sync

I would like to be sure that:
1. after point 3 in case of system crash the file config.change will be
visible on disk and have correct data
2. after point 4 in case of system crash in config.oryg I have correct
config.change or correct config.oryg data (depends when metadata are
flushed)
3. after point 5 in case of system crash in config.oryg I have data from
config.change

Of course I assume that config.oryg and config.change are on the same
filesystem.


Regards,

Olaf

-- 
Olaf FrÄczyk <olaf@xxxxxxxxxxxxx>


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