aboutsummaryrefslogtreecommitdiff
path: root/sys/gnu
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1998-09-26 07:16:41 +0000
committerBruce Evans <bde@FreeBSD.org>1998-09-26 07:16:41 +0000
commit7cff8977ca43b149e7efd1d3923fc635b900a867 (patch)
tree98c4145ac3258fa0534ebe1471c8557cf453a258 /sys/gnu
parenta094db128fe03483b7e1f3e2b16ef03047828a2b (diff)
Notes
Diffstat (limited to 'sys/gnu')
-rw-r--r--sys/gnu/ext2fs/ext2_vfsops.c20
-rw-r--r--sys/gnu/fs/ext2fs/ext2_vfsops.c20
2 files changed, 24 insertions, 16 deletions
diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c
index 0ec6c8ba18450..e3201291ce46b 100644
--- a/sys/gnu/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/ext2fs/ext2_vfsops.c
@@ -350,7 +350,7 @@ static int ext2_check_descriptors (struct ext2_sb_info * sb)
{
printf ("ext2_check_descriptors: "
"Block bitmap for group %d"
- " not in group (block %lu)!",
+ " not in group (block %lu)!\n",
i, (unsigned long) gdp->bg_block_bitmap);
return 0;
}
@@ -359,7 +359,7 @@ static int ext2_check_descriptors (struct ext2_sb_info * sb)
{
printf ("ext2_check_descriptors: "
"Inode bitmap for group %d"
- " not in group (block %lu)!",
+ " not in group (block %lu)!\n",
i, (unsigned long) gdp->bg_inode_bitmap);
return 0;
}
@@ -369,7 +369,7 @@ static int ext2_check_descriptors (struct ext2_sb_info * sb)
{
printf ("ext2_check_descriptors: "
"Inode table for group %d"
- " not in group (block %lu)!",
+ " not in group (block %lu)!\n",
i, (unsigned long) gdp->bg_inode_table);
return 0;
}
@@ -673,10 +673,12 @@ ext2_mountfs(devvp, mp, p)
ump->um_e2fs->s_es = bsd_malloc(sizeof(struct ext2_super_block),
M_UFSMNT, M_WAITOK);
bcopy(es, ump->um_e2fs->s_es, (u_int)sizeof(struct ext2_super_block));
- if(error = compute_sb_data(devvp, ump->um_e2fs->s_es, ump->um_e2fs)) {
- brelse(bp);
- return error;
- }
+ if ((error = compute_sb_data(devvp, ump->um_e2fs->s_es, ump->um_e2fs)))
+ goto out;
+ /*
+ * We don't free the group descriptors allocated by compute_sb_data()
+ * until ext2_unmount(). This is OK since the mount will succeed.
+ */
brelse(bp);
bp = NULL;
fs = ump->um_e2fs;
@@ -714,7 +716,8 @@ out:
brelse(bp);
(void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, p);
if (ump) {
- bsd_free(ump->um_fs, M_UFSMNT);
+ bsd_free(ump->um_e2fs->s_es, M_UFSMNT);
+ bsd_free(ump->um_e2fs, M_UFSMNT);
bsd_free(ump, M_UFSMNT);
mp->mnt_data = (qaddr_t)0;
}
@@ -754,6 +757,7 @@ ext2_unmount(mp, mntflags, p)
/* release buffers containing group descriptors */
for(i = 0; i < fs->s_db_per_group; i++)
ULCK_BUF(fs->s_group_desc[i])
+ bsd_free(fs->s_group_desc, M_UFSMNT);
/* release cached inode/block bitmaps */
for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++)
diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c
index 0ec6c8ba18450..e3201291ce46b 100644
--- a/sys/gnu/fs/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c
@@ -350,7 +350,7 @@ static int ext2_check_descriptors (struct ext2_sb_info * sb)
{
printf ("ext2_check_descriptors: "
"Block bitmap for group %d"
- " not in group (block %lu)!",
+ " not in group (block %lu)!\n",
i, (unsigned long) gdp->bg_block_bitmap);
return 0;
}
@@ -359,7 +359,7 @@ static int ext2_check_descriptors (struct ext2_sb_info * sb)
{
printf ("ext2_check_descriptors: "
"Inode bitmap for group %d"
- " not in group (block %lu)!",
+ " not in group (block %lu)!\n",
i, (unsigned long) gdp->bg_inode_bitmap);
return 0;
}
@@ -369,7 +369,7 @@ static int ext2_check_descriptors (struct ext2_sb_info * sb)
{
printf ("ext2_check_descriptors: "
"Inode table for group %d"
- " not in group (block %lu)!",
+ " not in group (block %lu)!\n",
i, (unsigned long) gdp->bg_inode_table);
return 0;
}
@@ -673,10 +673,12 @@ ext2_mountfs(devvp, mp, p)
ump->um_e2fs->s_es = bsd_malloc(sizeof(struct ext2_super_block),
M_UFSMNT, M_WAITOK);
bcopy(es, ump->um_e2fs->s_es, (u_int)sizeof(struct ext2_super_block));
- if(error = compute_sb_data(devvp, ump->um_e2fs->s_es, ump->um_e2fs)) {
- brelse(bp);
- return error;
- }
+ if ((error = compute_sb_data(devvp, ump->um_e2fs->s_es, ump->um_e2fs)))
+ goto out;
+ /*
+ * We don't free the group descriptors allocated by compute_sb_data()
+ * until ext2_unmount(). This is OK since the mount will succeed.
+ */
brelse(bp);
bp = NULL;
fs = ump->um_e2fs;
@@ -714,7 +716,8 @@ out:
brelse(bp);
(void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, p);
if (ump) {
- bsd_free(ump->um_fs, M_UFSMNT);
+ bsd_free(ump->um_e2fs->s_es, M_UFSMNT);
+ bsd_free(ump->um_e2fs, M_UFSMNT);
bsd_free(ump, M_UFSMNT);
mp->mnt_data = (qaddr_t)0;
}
@@ -754,6 +757,7 @@ ext2_unmount(mp, mntflags, p)
/* release buffers containing group descriptors */
for(i = 0; i < fs->s_db_per_group; i++)
ULCK_BUF(fs->s_group_desc[i])
+ bsd_free(fs->s_group_desc, M_UFSMNT);
/* release cached inode/block bitmaps */
for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++)