File system query
Dibyayan Chakraborty
dib.coolguy at gmail.com
Thu Jun 20 23:12:35 EDT 2013
Hi,
I am not familiar with btrfs. So i would like to follow in the foot steps
of ext3/ext4 file system.
I figure that the most basic functionality (and mandatory for my project)
is to recover from a system crash taking place before a file write is
complete. So, in order to this what should be the steps ?
Thanks.
On Fri, Jun 21, 2013 at 8:31 AM, <Valdis.Kletnieks at vt.edu> wrote:
> On Fri, 21 Jun 2013 07:06:37 +0530, Dibyayan Chakraborty said:
>
> > 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?
>
> That will depend on how *your* file system implements journalling.
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130621/d9e5acda/attachment.html
More information about the Kernelnewbies
mailing list