Journalling File System

From COMP15212 Wiki
Revision as of 10:03, 5 August 2019 by gravatar W81054ch [userbureaucratinterface-adminsysopPHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPmludGVyZmFjZS1hZG1pbjxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+] (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Depends on Filing System ImplementationSecurity

When doing some-set-of-operations in computing, not infrequently things which are logically simultaneous need to be done in sequence. Various examples appear … and probably more frequently in operating systems’ code than in general applications.

Updating a file is one example, especially if you allow for the possibility of faults, crashes and someone disconnecting the power half-way through.

Such problems are likely to occur most frequently in embedded systems, which often operate in reasonably hostile environments. These may also be systems where reliability is important: remember that computers are flying aeroplanes…

Without delving into significant detail it is possible to take actions which significantly help to improve reliability and recoverability.

For example, when ‘rewriting’ an existing file it can make sense to create a new (temporary) file instead. Only when it is certain that the update is complete (and, possibly, verified) is a ‘switch’ made and the ‘new’ file becomes ‘the’ file. The likelihood of a problem occurring at that moment is much less than the likelihood of a problem over the (prolonged?) period of file writing. Any problems and the previous version can be recovered intact. This is another place where the ordering of the sequence of operations is important.

This sort of operation can be important when the (part of the?) file system is, for example, in Flash memory where whole areas of the memory have to be erased before rewriting can start. Flash memory is used in ‘Thumb drives’, Tablets, ’phones, cameras … just about all portable computer equipment these days.


You might like to think of similar examples where a ‘commit’ needs to be an ‘all or nothing’ action for reliability: for example in database transactions, version control systems …


Also refer to: Operating System Concepts, 10th Edition: Chapter 14.7.2, pages 587-588


Articles on User
"Everything is a File" • Application Binary Interface (ABI) • Arrays • Boot • Buffer Overflow • Containers • Daemons • Disk Partition • Dynamic Memory Allocation • Emulator traps • Environment Variables • Errors • Exceptions • File Attributes • File Locking • File Permissions • Introduction to Operating Systems • Journalling File System • Links • Locks • Man(ual pages in Unix) • Memory Mapped Files • Monitoring • Network File System (NFS) • PATH • Pipes • Pointers • Relocatable Code • Reset • SETUID • Shell • Sockets • Spooling and Buffering • Streams • Structures • Superuser • System Calls • Unix Signals • User • Using Peripherals