diff options
Diffstat (limited to 'ext2fs/ialloc.c')
-rw-r--r-- | ext2fs/ialloc.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ext2fs/ialloc.c b/ext2fs/ialloc.c index b9b4147f..cc902a46 100644 --- a/ext2fs/ialloc.c +++ b/ext2fs/ialloc.c @@ -273,7 +273,7 @@ error_t diskfs_alloc_node (struct node *dir, mode_t mode, struct node **node) { error_t err; - int sex; + int sex, block; struct node *np; ino_t inum; @@ -296,6 +296,14 @@ diskfs_alloc_node (struct node *dir, mode_t mode, struct node **node) np->dn_set_ctime = 1; } + /* Zero out the block pointers in case there's some noise left on disk. */ + for (block = 0; block < EXT2_N_BLOCKS; block++) + if (np->dn->info.i_data[block] != 0) + { + np->dn->info.i_data[block] = 0; + np->dn_set_ctime = 1; + } + np->dn_stat.st_flags = 0; /* |