path: root/tests/f_invalid_extent_symlink/name
diff options
authorTheodore Ts'o <tytso@mit.edu>2013-07-28 21:49:38 -0400
committerTheodore Ts'o <tytso@mit.edu>2013-07-28 22:03:01 -0400
commitc8ec2bad18fdaa842f786f3b37c9320a3411aea3 (patch)
tree4c13783b8bfb32e94da5a419361e07a3d4f76997 /tests/f_invalid_extent_symlink/name
parentdd50ef87432284d93b9f39178c4fab242d76654e (diff)
e2fsck: correctly deallocate invalid extent-mapped symlinks
The function deallocate_inode() in e2fsck/pass2.c was buggy in that it would clear out the inode's mode and flags fields before trying to deallocate any blocks which might belong to the inode. The good news is that deallocate_inode() is mostly used to free inodes which do not have blocks: device inodes, FIFO's, Unix-domain sockets. The bad news is that if deallocate_inode() tried to free an invalid extent-mapped inode, it would try to interpret the root of the extent node as block numbers, and would therefore mark various file system metadata blocks (the superblock, block group descriptors, the root directory, etc.) as free and available for allocation. This was unfortunate. (Try running an older e2fsck against the test file system image in the new test f_invalid_extent_symlink, and then run e2fsck a second time on the fs image, and weep.) Fortunately, this kind of file system image corruption appears to be fairly rare in actual practice, since it would require a very unlucky set of bits to be flipped, or a buggy file system implementation. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'tests/f_invalid_extent_symlink/name')
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/f_invalid_extent_symlink/name b/tests/f_invalid_extent_symlink/name
new file mode 100644
index 00000000..3792aac7
--- /dev/null
+++ b/tests/f_invalid_extent_symlink/name
@@ -0,0 +1 @@
+extent-mapped symlink with two blocks