svn commit: r331491 - in head/sys/geom: journal label
Kirk McKusick
mckusick at FreeBSD.org
Sat Mar 24 15:36:26 UTC 2018
Author: mckusick
Date: Sat Mar 24 15:36:25 2018
New Revision: 331491
URL: https://svnweb.freebsd.org/changeset/base/331491
Log:
When freeing a superblock returned by ffs_sbget, be sure to also
free the superblock summary information.
Reported by: Peter Holm (pho@)
Tested by: Peter Holm (pho@)
Modified:
head/sys/geom/journal/g_journal_ufs.c
head/sys/geom/label/g_label_ufs.c
Modified: head/sys/geom/journal/g_journal_ufs.c
==============================================================================
--- head/sys/geom/journal/g_journal_ufs.c Sat Mar 24 13:51:27 2018 (r331490)
+++ head/sys/geom/journal/g_journal_ufs.c Sat Mar 24 15:36:25 2018 (r331491)
@@ -83,6 +83,7 @@ g_journal_ufs_dirty(struct g_consumer *cp)
fs->fs_clean = 0;
fs->fs_flags |= FS_NEEDSFSCK | FS_UNCLEAN;
error = ffs_sbput(cp, fs, fs->fs_sblockloc, g_use_g_write_data);
+ g_free(fs->fs_csp);
g_free(fs);
if (error != 0) {
GJ_DEBUG(0, "Cannot mark file system %s as dirty "
Modified: head/sys/geom/label/g_label_ufs.c
==============================================================================
--- head/sys/geom/label/g_label_ufs.c Sat Mar 24 13:51:27 2018 (r331490)
+++ head/sys/geom/label/g_label_ufs.c Sat Mar 24 15:36:25 2018 (r331491)
@@ -103,8 +103,7 @@ g_label_ufs_taste_common(struct g_consumer *cp, char *
|| G_LABEL_UFS_CMP(pp, fs, fs_providersize))) {
/* Valid UFS2. */
} else {
- g_free(fs);
- return;
+ goto out;
}
G_LABEL_DEBUG(1, "%s file system detected on %s.",
fs->fs_magic == FS_UFS1_MAGIC ? "UFS1" : "UFS2", pp->name);
@@ -120,6 +119,8 @@ g_label_ufs_taste_common(struct g_consumer *cp, char *
fs->fs_id[1]);
break;
}
+out:
+ g_free(fs->fs_csp);
g_free(fs);
}
More information about the svn-src-all
mailing list