aboutsummaryrefslogtreecommitdiff
path: root/debugfs/util.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2005-03-20 20:05:22 -0500
committerTheodore Ts'o <tytso@mit.edu>2005-03-20 20:05:22 -0500
commit030970ed750b6a169c32ffb8b19bce3150198629 (patch)
treeb02d1738b6786d0d9c2bbf2f246a2f8eb31ab2c4 /debugfs/util.c
parentea822eeba373bd0bed6e58a35ce123a9f2768113 (diff)
downloade2fsprogs-030970ed750b6a169c32ffb8b19bce3150198629.tar.gz
Fix e2fsck, debugfs, and the ext2fs_mkdir function so that when we create
a new inode we make sure that the extra information in the inode (any extra fields in a large inode and any ea-in-inode information) is cleared. This can happen when e2fsck creates a new root inode or a new lost+found directory, or when the user uses the debugfs write, mknod, or mkdir commands. Otherwise, the newly create inode could inherit garbage (or old EA information) from a previously deleted inode.
Diffstat (limited to 'debugfs/util.c')
-rw-r--r--debugfs/util.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/debugfs/util.c b/debugfs/util.c
index b74a7bd2..ce1a2f3a 100644
--- a/debugfs/util.c
+++ b/debugfs/util.c
@@ -346,3 +346,15 @@ int debugfs_write_inode(ext2_ino_t ino, struct ext2_inode * inode,
return 0;
}
+int debugfs_write_new_inode(ext2_ino_t ino, struct ext2_inode * inode,
+ const char *cmd)
+{
+ int retval;
+
+ retval = ext2fs_write_new_inode(current_fs, ino, inode);
+ if (retval) {
+ com_err(cmd, retval, "while creating inode %u", ino);
+ return 1;
+ }
+ return 0;
+}