File system query

Valdis.Kletnieks at Valdis.Kletnieks at
Thu Jun 20 23:39:19 EDT 2013

On Fri, 21 Jun 2013 08:42:35 +0530, Dibyayan Chakraborty said:

> 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 ?

As I said, that will depend on how your file system works.

Write transaction to journal.
Apply transaction to filesystem.
Delete transaction from journal.

Anything more specific than that will be file system dependent.  You'll
have to figure out what a "transaction" is, and how to apply one, and
how to roll one back if needed, and how to re-apply a partly applied one.
Remember that at the start and end of each transaction, your filesystem
has to be consistent - all blocks are either allocated to a file or on
the free list, a directory has sane . and .. entries, and so on.

Hint:  Write your fsck program first.  Seriously. :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : 

More information about the Kernelnewbies mailing list