summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-04-28 20:04:37 +0000
committerMiles Bader <miles@gnu.org>1995-04-28 20:04:37 +0000
commit028b7d6d30d8a965036784826b15670a836a14bd (patch)
tree4fe0371cf9bd913de8f36d87ba077d7afb6abebb
parentbc0127f25556d0b50a3459a9466c56e4a9bf6ea6 (diff)
Formerly ialloc.c.~22~
-rw-r--r--ext2fs/ialloc.c10
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;
/*