summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksym Planeta <mcsim.planeta@gmail.com>2012-10-07 20:31:02 +0300
committerMaksym Planeta <mcsim.planeta@gmail.com>2012-10-07 21:30:47 +0300
commit6a739822961318c0141c7c38bd573229da8745b2 (patch)
treedb68959ef73a37bef8cbb0110ff5186e787b955e
parent6f02e041d7f5c7a24bf5a6263dbfd7bc97e80a80 (diff)
Make sure that function read_node will not get bad data.
* ext2fs/ialloc.c (ext2_alloc_inode): Function is changed.
-rw-r--r--ext2fs/ialloc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext2fs/ialloc.c b/ext2fs/ialloc.c
index eee28b82..48361cb9 100644
--- a/ext2fs/ialloc.c
+++ b/ext2fs/ialloc.c
@@ -268,6 +268,14 @@ repeat:
spin_unlock (&global_lock);
alloc_sync (0);
+ /* Make sure the coming read_node won't complain about bad
+ fields. */
+ {
+ struct ext2_inode *di = dino_ref (inum);
+ memset (di, 0, sizeof *di);
+ dino_deref (di);
+ }
+
return inum;
}