xfs
[Top] [All Lists]

Re: Gaurenteed file write??

To: Wendy Cheng <s_wendy_cheng@xxxxxxxxxxx>
Subject: Re: Gaurenteed file write??
From: Steve Lord <lord@xxxxxxx>
Date: 15 Oct 2002 14:04:35 -0500
Cc: xfs mailing list <linux-xfs@xxxxxxxxxxx>
In-reply-to: <OE72WNVExC7g4ENbdBy00009bd2@xxxxxxxxxxx>
References: <20021015180506.NXFR22240.imf13bis.bellsouth.net@Mother2> <1034707513.1783.54.camel@xxxxxxxxxxxxxxxxxxxx> <OE72WNVExC7g4ENbdBy00009bd2@xxxxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
On Tue, 2002-10-15 at 14:03, Wendy Cheng wrote:
> Along the same line, if I mount the file system synchronously (forget about
> performance for now), will any write gets gaurenteed to get flushed into the
> disk ? More specifically, if I do
> step 1: mount fs synchronously
> step 2: execute a program that does a fwrite() and ends.
> step 3: purposely power off the system.
> step 4: reboot.
> 
> Could I see my file there after step 4 ? Thank you for the help.

Use wsync and sync mount options. That should do it. Probably sync on
its own is enough. wsync makes xfs transactions synchronous, but the
sync will make file writes synchronous and that flushes the log too.

Steve

> 
> Wendy
> --------
> ----- Original Message -----
> From: "Steve Lord" <lord@xxxxxxx>
> To: "Greg Freemyer" <freemyer@xxxxxxxxxxxxxxxxx>
> Cc: "xfs mailing list" <linux-xfs@xxxxxxxxxxx>
> Sent: Tuesday, October 15, 2002 2:45 PM
> Subject: Re: Gaurenteed file write??
> 
> 
> | On Tue, 2002-10-15 at 13:03, Greg Freemyer wrote:
> | > All,
> | >
> | > I have an iteration counter that I update every night.
> | >
> | >     echo $ITERATION > /backup/iteration
> | >
> | > Recently this file was reset to 0.
> | >
> | > I suspect it was a case of the "zero filled file".
> | >
> | > For this specific file and shell script, what extra logic can I add that
> would give me the highest likelihood of a successful disk write.
> | >
> | > i.e. Would sync; sync;  increase my odds of always successfully writing
> this file out?
> | >
> | > TIA
> | > Greg Freemyer
> | >
> | >
> |
> | Write a little program which opens a file and calls fsync on it. sync
> | should do it too.
> |
> | Steve
> |
> | --
> |
> | Steve Lord                                      voice: +1-651-683-3511
> | Principal Engineer, Filesystem Software         email: lord@xxxxxxx
> |
-- 

Steve Lord                                      voice: +1-651-683-3511
Principal Engineer, Filesystem Software         email: lord@xxxxxxx


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