Hi,
I am not familiar with btrfs. So i would like to follow in the foot steps of ext3/ext4 file system.On Fri, Jun 21, 2013 at 8:31 AM, <Valdis.Kletnieks@xxxxxx> wrote:
On Fri, 21 Jun 2013 07:06:37 +0530, Dibyayan Chakraborty said:That will depend on how *your* file system implements journalling.
> I am obviously one step closer to implementing the journaling in file
> system. But i didn't et the following things.
>
> What would be the correct sequence of steps in implementing it?
The correct sequence of steps for ext4 to do journaling is different
from how btrfs does its transaction journal.
In general, the tricky part is that after you log to the journal, you
still have to apply the updates to the filesystem - and do so in such a
way that if the system crashes while updating, you can always look at the
filesystem and the journal, and find a way to replay or rollback to put
the filesystem back to a consistent state. And there's *plenty* of corner
cases to deal with. For instance, log a file allocation to the journal, then
update the filesystem - but then die before you can flag the journal entry as
"written to filesystem". You need to detect that it's a replay of an already
done event, and do something about it.
The *real* fun is trying to distinguish between "written to disk but not
removed from journal" and "90% updated to disk but not removed from journal" :)
--
With Regards
Dibyayan Chakraborty
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies