mirror of
https://github.com/opnsense/src.git
synced 2026-04-29 18:32:49 -04:00
Fixed initialization of new inodes. ext2fs doesn't clear inodes when
they are deleted, so inodes must be cleared when they are reused, but we didn't clear the indirect blocks. This caused serious filesystem corruption.
This commit is contained in:
parent
5d20b9915f
commit
9702cd0422
2 changed files with 6 additions and 2 deletions
|
|
@ -416,8 +416,10 @@ ext2_valloc(pvp, mode, cred, vpp)
|
|||
ip->i_blocks = 0;
|
||||
ip->i_flags = 0;
|
||||
/* now we want to make sure that the block pointers are zeroed out */
|
||||
for(i = 0; i < EXT2_NDIR_BLOCKS; i++)
|
||||
for (i = 0; i < NDADDR; i++)
|
||||
ip->i_db[i] = 0;
|
||||
for (i = 0; i < NIADDR; i++)
|
||||
ip->i_ib[i] = 0;
|
||||
|
||||
/*
|
||||
* Set up a new generation number for this inode.
|
||||
|
|
|
|||
|
|
@ -416,8 +416,10 @@ ext2_valloc(pvp, mode, cred, vpp)
|
|||
ip->i_blocks = 0;
|
||||
ip->i_flags = 0;
|
||||
/* now we want to make sure that the block pointers are zeroed out */
|
||||
for(i = 0; i < EXT2_NDIR_BLOCKS; i++)
|
||||
for (i = 0; i < NDADDR; i++)
|
||||
ip->i_db[i] = 0;
|
||||
for (i = 0; i < NIADDR; i++)
|
||||
ip->i_ib[i] = 0;
|
||||
|
||||
/*
|
||||
* Set up a new generation number for this inode.
|
||||
|
|
|
|||
Loading…
Reference in a new issue