Towards Robust File System Checkers

Towards Robust File System Checkers

Towards Robust File System Checkers Om Rameshwar Gatla, Muhammad Hameed, and Mai Zheng, New Mexico State University; Viacheslav Dubeyko, Adam Manzanares, Filip Blagojevic, Cyril Guyot, and Robert Mateescu, Western Digital Research https://www.usenix.org/conference/fast18/presentation/gatla This paper is included in the Proceedings of the 16th USENIX Conference on File and Storage Technologies. February 12–15, 2018 • Oakland, CA, USA ISBN 978-1-931971-42-3 Open access to the Proceedings of the 16th USENIX Conference on File and Storage Technologies is sponsored by USENIX. Towards Robust File System Checkers Om Rameshwar Gatla†, Muhammad Hameed†, Mai Zheng†, Viacheslav Dubeyko‡, Adam Manzanares‡, Filip Blagojevic‡, Cyril Guyot‡, Robert Mateescu‡ †New Mexico State University ‡Western Digital Research Abstract ages, server crashes, latent sector errors, software bugs, File systems may become corrupted for many reasons etc [19, 20, 31, 51, 54]. despite various protection techniques. Therefore, most File system checkers, such as e2fsck for Ext-family file systems come with a checker to recover the file sys- file systems [3], serve as the last line of defense to re- tem to a consistent state. However, existing checkers cover a corrupted file system back to a healthy state [54]. are commonly assumed to be able to complete the repair They contain intimate knowledge of file system metadata without interruption, which may not be true in practice. structures, and are commonly assumed to be able to com- In this work, we demonstrate via fault injection ex- plete the repair without interruption. periments that checkers of widely used file systems may Unfortunately, the same issues that lead to file system leave the file system in an uncorrectable state if the re- inconsistencies (e.g., power outages or crashes), can also pair procedure is interrupted unexpectedly. To address occur during file system repair. One real-world example the problem, we first fix the ordering issue in the undo happened at the High Performance Computing Center in logging of e2fsck, and then build a general logging li- Texas [17]. In this accident, multiple Lustre file systems brary (i.e., rfsck-lib) for strengthening checkers. To suffered severe data loss after power outages: the first demonstrate the practicality, we integrate rfsck-lib outage triggered the Lustre checker (lfsck [6]) after the with existing checkers and create two new checkers: (1) cluster was restarted, while another outage interrupted rfsck-ext, a robust checker for Ext-family file systems, lfsck and led to the downtime and data loss. Because and (2) rfsck-xfs, a robust checker for XFS file sys- Lustre is built on top of a variant of Ext4 (ldiskfs [9]), tem, both of which require only tens of lines of modi- and lfsck relies on e2fsck to fix local inconsistencies fication to the original versions. Both rfsck-ext and on each node, the checking and repairing is complicated rfsck-xfs are resilient to faults in our experiments. (e.g., requiring several days [17]). As of today, it is still Also, both checkers incur reasonable performance over- unclear which step of lfsck/e2fsck caused the uncor- head (i.e., up to 12%) comparing to the original unre- rectable corruptions. With the trend of increasing the liable versions. Moreover, rfsck-ext outperforms the storage capacity and scaling to more and more nodes, patched e2fsck by up to nine times while achieving the checking and repairing file systems will likely become same level of robustness. more time-consuming and thus more vulnerable to faults. Such accidents and observation motivate us to remove 1 Introduction the assumption that file system checkers can always fin- Achieving data integrity is critical for computer systems ish normally without interruption. ranging from a single desktop to large-scale distributed Previous research has demonstrated that file system storage clusters [21]. In order to make sense of the ever checkers themselves are error-prone [27, 42]. File sys- increasing amount of data stored, it is common to use tem specific approaches have also been developed that local (e.g., Ext4 [4], XFS [70], F2FS [49]) and multi- use higher level languages to elegantly describe file sys- node file systems (e.g., HDFS [66], Ceph [74], Lus- tem repair tasks [42]. In addition, efforts have also been tre [9]) to organize the data on top of storage devices. made to speed up the repair procedure, which leads to Although file systems are designed to maintain the data a smaller window of potential data loss due to an inter- integrity [36, 38, 45, 60, 72, 75], situations arise when ruption [54]. Although these efforts improve file system the file system metadata needs to be checked for in- checkers, they do not address the fundamental issue of tegrity. Such situations may be caused by power out- improving the resilience of checkers in the face of unex- USENIX Association 16th USENIX Conference on File and Storage Technologies 105 pected interruptions. the complexity as well as the potential vulnerabilities of In this work, we first demonstrate that the check- checkers in this section. ers of widely used file systems (i.e., e2fsck [3] and xfs repair [14]) may leave the file system in an uncor- 2.1 Workflow of e2fsck rectable state if the repair procedure is unexpectedly in- terrupted. We collect corrupted file system images from e2fsck is the checker of the widely used Ext-family file file system developers and additionally generate test im- systems. It first replays the journal (in case of Ext3 and ages to trigger the repair procedure. Moreover, we de- Ext4) and then restarts itself. Next, e2fsck runs the fol- velop rfsck-test, an automatic fault injection tool, to lowing five passes in order: systematically inject faults during the repair, and thus Pass-1: Scan the file system and check inodes. e2fsck manifest the vulnerabilities. scans the entire volume and stores information of all in- To address the problem exposed in our study, we an- odes into a set of bitmaps. In addition, it performs four alyze the undo logging feature of e2fsck in depth, and sub-passes to generate a list of duplicate blocks and their identify an ordering issue which jeopardizes its effective- owners, check the integrity of extent trees, etc. ness. We fix the issue and create a patched version called Pass-2: Check directory structure. Based on the e2fsck-patch which is truly resilient to faults. bitmap information, e2fsck iterates through all direc- However, we find that e2fsck-patch is inherently tory inodes and checks a set of rules for each directory. suboptimal as it requires extensive sync operations. To address the limitation, and to improve the checkers of Pass-3: Check directory connectivity. e2fsck first other file systems, we design and implement rfsck-lib, checks if a root directory is available; if not, a new root a general logging library with a simple interface. Based directory is created and is marked “done”. Then it tra- on the similarities among checkers, rfsck-lib decou- verses the directory tree, checks the reachability of each ples the logging from the repairing, and provides an in- directory inode, breaks directory loops, etc. terface to log the repairing writes in fine granularity. Pass-4: Check reference counts. e2fsck iterates over To demonstrate the practicality, we integrate all inodes to validate the inode link counts. Also, it rfsck-lib with existing checkers and create two checks the connectivity of the extended attribute blocks new checkers: (1) rfsck-ext, a robust checker for Ext- and reconnects them if necessary. family file systems, which adds 50 lines of code (LoC) Pass-5: Recalculate checksums and flush updates. Fi- to e2fsck; and (2) rfsck-xfs, a robust checker for nally, e2fsck checks the repaired in-memory data struc- 1 XFS file system, which adds 15 LoC to xfs repair. tures against on-disk data structures and flushes neces- Both rfsck-ext and rfsck-xfs are resilient to faults sary updates to the disk. in our experiments. Also, both checkers incur reasonable performance overhead (i.e., up to 12%) compared to the original unreliable versions. Moreover, rfsck-ext 2.2 Workflow of xfs repair outperforms e2fsck-patch by up to nine times while xfs repair is the checker of the popular XFS file sys- achieving the same level of fault resilience. tem.2 Similar to e2fsck, xfs repair fixes incon- The rest of the paper is organized as follows. First, we sistencies in seven passes (or phases), including: Pass- introduce the background of file system checkers (x2). 1, superblock verification; Pass-2, replay logs, validate Next, we describe rfsck-test and study e2fsck and maps and the root inode; Pass-3, check inodes in each xfs repair (x3). We analyze the ordering issue of allocation group; Pass-4, check duplicate block alloca- the undo logging of e2fsck in x4. Then, we introduce tions; Pass-5, rebuild the allocation group structure and rfsck-lib and integrate it with existing checkers ( x5). superblock; Pass-6, check inode connectivity; Pass-7, We evaluate rfsck-ext and rfsck-xfs in x6, and dis- verify and correct link counts. cuss several issues in x7. Finally, we discuss related work Unlike e2fsck which is single-threaded, (x8) and conclude (x9). xfs repair employs multi-threading in passes 2, 2 Background 3, 6 and 7 to improve the performance. Nevertheless, we can see that both checkers are complicated and may Most file systems employ checkers to check and repair be vulnerable to faults. For example, later passes may inconsistencies. The checkers are usually file system depend on previous passes, and there is no atomicity specific, and they examine different consistency rules de- guarantee for related updates. We describe our method pending on the metadata structures.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    18 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us