On 11/04/2011 11:21 AM, Phillip Susi wrote:
> Given how a transaction is committed, why is there a tree-log?  When
> modifying the tree, either the super block is still pointing to the
> old tree root, or the new generation has been fully committed, so how
> can there ever be an intermediate state that needs a log to recover?

tree-log is for improving the preformance  of fsync and and O_SYNCs.

Btrfs has an expensive "commit transaction", if we commit a transaction every 
time we fsync,
the performance is not that good.  Instead of this, we introduce a write-ahead 
log to make
our fsync faster.

So if you do fsync for your data, it means your data is safely in the log tree,
then if a crash takes place, the data can be recovered from log.

More details are in tree-log.c.

thanks,
liubo
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to