xfs
[Top] [All Lists]

Re: different behaviour between XFS and ext3

To: Blair Barnett <bbarnett@xxxxxxxxxx>, linux-xfs@xxxxxxxxxxx
Subject: Re: different behaviour between XFS and ext3
From: Klaus Strebel <klaus.strebel@xxxxxxxxxx>
Date: Thu, 31 Jul 2003 10:08:03 +0200
In-reply-to: <3F283E36.778CC934@mvista.com>
Organization: EIGNER Germany GmbH
References: <3F283E36.778CC934@mvista.com>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624
Blair Barnett wrote:
Hi,

I have a simple shell script that writes numbers to a file and every 10
numbers does a sync and after 40 does a reboot. I've attached the script
to this email.

If the file is written to an EXT3 filesystem, then file contains the
numbers 1-40. However, if the file is written to an XFS 1.1,1.2, or 1.3
filesystem, then file contains the numbers 1-10.

Can someone tell me if this is a feature of XFS or a bug?

Hi Blair,

your in danger do get flamed ;-) though:

The man-page of mount states in the options for ext3:

data=journal / data=ordered / data=writeback
              Specifies  the  journalling  mode  for  file  data.
              Metadata is always journaled.

              journal
                     All data is committed into the journal prior
                     to being written into the main file  system.

              ordered
                     This  is  the  default  mode.   All  data is
                     forced directly out to the main file  system
                     prior to its metadata being committed to the
                     journal.

              writeback
                     Data ordering is not preserved - data may be
                     written  into the main file system after its
                     metadata has been committed to the  journal.
                     This  is rumoured to be the highest-through­
                     put option.   It  guarantees  internal  file
                     system  integrity,  however it can allow old
                     data to appear in files after  a  crash  and
                     journal recovery.

So, your ext3 does a data=ordered (if you didn't change it, obviously you didn't, you would have known the man-page ;-) ), while xfs's behaviour is more like data=writeback. In special circumstances this can even lead to data loss on xfs (see a thread in linux-xfs@xxxxxxxxxxx, metadata is written, extents for the file are zeroed out but data's not written to, well should almost never happen in actual CVS kernel ;-)).

Cheers
Klaus

--
Klaus Strebel
UNIX-Engineer
klaus.strebel@xxxxxxxxxx
EIGNER - Precision Lifecycle Management -
<http://www.eigner.com>


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