Question: Journaling You are now given some tasks about a journaling file system. The first task is to figure out what blocks would end up in

Journaling

You are now given some tasks about a journaling file system. The first task is to figure out what blocks would end up in a journal transaction, given some base knowledge of the system. We assume for these first questions that the system under inspection uses data journaling mode, in which all blocks (metadata and data) are first journaled before being updated in place. Assume the standard structures of a file system here: an inode bitmap, a data bitmap, a table of inodes, and data blocks.

Important: For the questions below, ignore any additional journal metadata that would be written (i.e., a transaction start and end block), and assume no reads to disk need to take place to complete the given action (i.e., relevant structures are cached in memory).

Question 46: Now assume that a process reads a block from a file. Reading, in this file system, updates the last accessed time field in the inode. How many blocks are written to the journal as part of this read?

a) 1 b) 2 c) 3 d) 4 e) None of the above

Question 47: Now a process creates a 0-byte file in the root directory (which does not have many entries in it, so there is room for another entry in an existing directory data block). How many blocks are written to the journal as part of this file creation?

a) 1 b) 2 c) 3 d) 4 e) None of the above

Question 48: Finally, a process deletes a 1-byte file from the root directory (leaving the root directory empty). Assuming the root directory only uses a single data block for its data, how many blocks are written to the journal as part of this file creation?

a) 1 b) 2 c) 3 d) 4 e) None of the above

Finally, you are asked a few questions about journaling, to see if your above answers can be trusted.

Question 49: Which of the following statements is NOT true about journaling file systems? a) Journaling adds a new on-disk structure to the file system b) Journaling is the same as write-ahead logging (the terms are used interchangeably) c) Journaling generally increases the amount of write traffic to the disk

d) Journaling always makes performance worse (than the same file system without journaling) e) Whether in data or ordered journaling modes, file system metadata is always first written to the journal

before being updated in place.

Question 50: Which of the following best represents a final, complete, and most optimized version of the ordered (metadata only) journaling protocol?

a) Data write, then journal metadata write, then journal commit. b) Data write, then journal metadata write, then journal commit, then checkpoint of metadata. c) Data write, then journal metadata write, then journal commit, then checkpoint of metadata, then (later)

mark the transaction free in the journal superblock. d) Data write and journal metadata write (concurrently), then journal commit, then checkpoint of

metadata, then (later) mark the transaction free in the journal superblock.

e) None of the above

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!