Journalling File System: Difference between revisions

From COMP15212 Wiki
gravatar Yuron [userbureaucratinterface-adminsysopPHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPmludGVyZmFjZS1hZG1pbjxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+] (talk | contribs)
m (1 revision imported)
gravatar W81054ch [userbureaucratinterface-adminsysopPHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPmludGVyZmFjZS1hZG1pbjxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+] (talk | contribs)
m (1 revision imported)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{#set: Priority=1 | Summary=A means of increasing the robustness of a filing system.  Akin to version control, for files.}}<!--
{{#set: Priority=1 | Summary=A means of increasing the robustness of a filing system.  Akin to version control, for files.}}<!--
-->{{#invoke:Dependencies|add|Filing System Implementation,3|Security,2}}
-->{{#invoke:Dependencies|add|Filing System Implementation,3|Security,2}}
When doing some-set-of-operations in computing, not infrequently
When doing some-set-of-operations in computing, not infrequently things which are [[Atomicity|<strong>logically simultaneous</strong>]] need to be done <strong>in sequence</strong>.  Various examples appear … and probably more frequently in operating systems’ code than in general applications.
things which are [[Atomicity|<strong>logically simultaneous</strong>]] need to be
done <strong>in sequence</strong>.  Various examples appear … and probably more
frequently in operating systems’ code than in general applications.


Updating a [[Files|file]] is one example, especially if you allow for
Updating a [[Files|file]] is one example, especially if you allow for the possibility of faults, crashes and someone disconnecting the power half-way through.
the possibility of faults, crashes and someone disconnecting the power
half-way through.
<blockquote>
<blockquote>
Such problems are likely to occur most frequently in <em>embedded
Such problems are likely to occur most frequently in <em>embedded systems</em>, which often operate in reasonably hostile environments. These may also be systems where reliability is important: remember that computers are flying aeroplanes…
systems</em>, which often operate in reasonably hostile environments.
These may also be systems where reliability is important: remember
that computers are flying aeroplanes…
</blockquote>
</blockquote>
Without delving into [https://en.wikipedia.org/wiki/Journaling_file_system significant detail] it is
Without delving into [https://en.wikipedia.org/wiki/Journaling_file_system significant detail] it is possible to take actions which significantly help to improve reliability and recoverability.
possible to take actions which significantly help to improve
reliability and recoverability.


For example, when ‘rewriting’ an existing file it can make
For example, when ‘rewriting’ an existing file it can make sense to create a <em>new</em> (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
sense to create a <em>new</em> (temporary) file instead.  Only when it is
‘the’ file.  The likelihood of a problem occurring at that moment is much less than the likelihood of a problem over the
certain that the update is complete (and, possibly, verified) is a
(prolonged?) period of file writing.  Any problems and the previous version can be recovered intact. This is another place where the [[Operation Ordering|ordering]] of the sequence of operations is important.
‘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 [[Operation Ordering|ordering]] of the sequence
of operations is important.
<blockquote>
<blockquote>
This sort of operation can be important when the (part of the?) file
This sort of operation can be important when the (part of the?) file system is, for example, in [https://en.wikipedia.org/wiki/Flash_memory 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 <em>portable</em> computer equipment these days.
system is, for example, in [https://en.wikipedia.org/wiki/Flash_memory 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 <em>portable</em> computer
equipment these days.
</blockquote>
</blockquote>
----
----
You might like to think of similar examples where a
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 …
‘commit’ needs to be an ‘all or nothing’
action for reliability: for example in database transactions, version
control systems …
----
----
 
{{BookChapter|14.7.2|587-588}}
{{PageGraph}}
{{PageGraph}}
{{Category|Filing System}}
{{Category|Filing System}}
{{Category|Security}}
{{Category|Security}}
{{Category|User}}
{{Category|User}}

Latest revision as of 10:03, 5 August 2019

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