xfs
[Top] [All Lists]

Re: transaction in XFS

To: jin hee park <jinny84@xxxxxxxxxxx>
Subject: Re: transaction in XFS
From: Steve Lord <lord@xxxxxxx>
Date: 15 Jul 2003 12:16:05 -0500
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <20030715004415.15068.qmail@xxxxxxxxxxxxxxxxxxxxxxx>
Organization:
References: <20030715004415.15068.qmail@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
On Mon, 2003-07-14 at 19:44, jin hee park wrote:
> Hello, Steve
> thank you for a clear explanation.
> 
> For example, there are four extents to truncate in a
> file. Maybe two transacions (each transaction for two
> extents deletion) will occur.
> If there is a crash in the middle of two transactions
> (the one : incore log was logged to disk log, and the
> other : incore log was not logged to disk log),
> doesn't the other work?
> I mean that the one worked, and the other didn't work.
> How can I understand this?

If the file is being deleted then it is placed on the unlinked
inode list when the remove is performed. When the inode goes
inactive, the extents are freed. At the end of freeing the
extents the inode itself is freed, so there are more transactions
than just removing the extents.

If the crash happens at any time after the transaction which 
puts the inode on the unlinked list, the remainder of the
process of deleting the file happens during the recovery
processing in the next mount. If this transaction did not
make it out to disk, then the file will still be there 
after the crash.

For inodes which are being truncated without being unlinked
then the truncate may be partial after recovery. ext3 places
these inodes on its 'unlinked' list too so the truncate
gets completed after recovery I have been considering doing
this for xfs too.

Steve

> 
> --- Steve Lord <lord@xxxxxxx> wrote:
> > On Mon, 2003-07-14 at 06:50, jin hee park wrote:
> > > Hello~
> > > 
> > > I have a question about transaction in XFS.
> > > 
> > > Are transactions (which are chained using
> > > xfs_trans_dup function) atomic?
> > > I wonder that such transactions are like one
> > > transacion idea(all or nothing).
> > > please, let me know..
> > > 
> > > thank you.
> > > - JinHee
> > > 
> > 
> > These transactions are not atomic, each one records
> > sufficient
> > information to rebuild a consistent filesystem after
> > a crash.
> > 
> > An example use of chained transactions is deleting
> > extents in a
> > file, the amount of log space this needs is
> > unbounded - a function
> > of the number of extents in the file. We cannot do
> > the whole
> > sequence in one transaction, so we use a chain of
> > them.
> > 
> > Steve
> > 
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
-- 

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


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