FreeBSD Bugzilla – Attachment 197091 Details for
Bug 230704
All the memory eaten away by ZFS 'solaris' malloc
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
vdev_geom_read_config_leak.diff (text/plain), 2.07 KB, created by
Mark Johnston
on 2018-09-14 15:56:20 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Mark Johnston
Created:
2018-09-14 15:56:20 UTC
Size:
2.07 KB
patch
obsolete
>diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c >index aa8a400f2d78..7794bd505525 100644 >--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c >+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c >@@ -415,9 +415,10 @@ vdev_geom_io(struct g_consumer *cp, int *cmds, void **datas, off_t *offsets, > * least one valid label was found. > */ > static int >-vdev_geom_read_config(struct g_consumer *cp, nvlist_t **config) >+vdev_geom_read_config(struct g_consumer *cp, nvlist_t **configp) > { > struct g_provider *pp; >+ nvlist_t *config; > vdev_phys_t *vdev_lists[VDEV_LABELS]; > char *buf; > size_t buflen; >@@ -442,7 +443,6 @@ vdev_geom_read_config(struct g_consumer *cp, nvlist_t **config) > > buflen = sizeof(vdev_lists[0]->vp_nvlist); > >- *config = NULL; > /* Create all of the IO requests */ > for (l = 0; l < VDEV_LABELS; l++) { > cmds[l] = BIO_READ; >@@ -458,6 +458,7 @@ vdev_geom_read_config(struct g_consumer *cp, nvlist_t **config) > VDEV_LABELS); > > /* Parse the labels */ >+ config = *configp = NULL; > nlabels = 0; > for (l = 0; l < VDEV_LABELS; l++) { > if (errors[l] != 0) >@@ -465,25 +466,27 @@ vdev_geom_read_config(struct g_consumer *cp, nvlist_t **config) > > buf = vdev_lists[l]->vp_nvlist; > >- if (nvlist_unpack(buf, buflen, config, 0) != 0) >+ if (nvlist_unpack(buf, buflen, &config, 0) != 0) > continue; > >- if (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_STATE, >+ if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_STATE, > &state) != 0 || state > POOL_STATE_L2CACHE) { >- nvlist_free(*config); >- *config = NULL; >+ nvlist_free(config); > continue; > } > > if (state != POOL_STATE_SPARE && > state != POOL_STATE_L2CACHE && >- (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_TXG, >+ (nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, > &txg) != 0 || txg == 0)) { >- nvlist_free(*config); >- *config = NULL; >+ nvlist_free(config); > continue; > } > >+ if (*configp != NULL) >+ nvlist_free(*configp); >+ *configp = config; >+ > nlabels++; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 230704
: 197091