It was found, that if cg descriptors bread() will return error, the fs->e2fs_gd and fs->e2fs_contigdirs sb fields will be freed twice.
Immediately after bread() call and at the bottom of the ext2_mountfs() function.
It is not possible to free these in-memory superblocks fields immediately after bread(), because the compute_sb_data() function is used in case of ro/rw remounting.
So, choose the second place and remove free() calls immediately after bread().
Details
Details
- Reviewers
pfg - Commits
- rS345272: MFC: r344757:
rS344757: Fix double free in case of mount error.
Tested manually with problem fs image.
And some ro/rw remount manual tests had place.
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/fs/ext2fs/ext2_vfsops.c | ||
---|---|---|
474 ↗ | (On Diff #54470) | Remove "The" from here: we are talking about two things so we cannot use a singular. |