summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChunwei Chen <[email protected]>2019-10-28 09:49:44 -0700
committerBrian Behlendorf <[email protected]>2019-10-28 09:49:44 -0700
commit7125a109dcc55628336ff3f58e59e503f4d7694d (patch)
tree1952966258041a0c3f4fc1dead0db1ed32548e0f /include
parente35704647e84c62c6a6017ead0b66b446010e4ff (diff)
Fix zpool history unbounded memory usage
In original implementation, zpool history will read the whole history before printing anything, causing memory usage goes unbounded. We fix this by breaking it into read-print iterations. Reviewed-by: Tom Caputi <[email protected]> Reviewed-by: Matt Ahrens <[email protected]> Reviewed-by: Igor Kozhukhov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Chunwei Chen <[email protected]> Closes #9516
Diffstat (limited to 'include')
-rw-r--r--include/libzfs.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/libzfs.h b/include/libzfs.h
index 7828a2759..8e9f6fb3f 100644
--- a/include/libzfs.h
+++ b/include/libzfs.h
@@ -432,7 +432,8 @@ typedef enum {
extern char *zpool_vdev_name(libzfs_handle_t *, zpool_handle_t *, nvlist_t *,
int name_flags);
extern int zpool_upgrade(zpool_handle_t *, uint64_t);
-extern int zpool_get_history(zpool_handle_t *, nvlist_t **);
+extern int zpool_get_history(zpool_handle_t *, nvlist_t **, uint64_t *,
+ boolean_t *);
extern int zpool_events_next(libzfs_handle_t *, nvlist_t **, int *, unsigned,
int);
extern int zpool_events_clear(libzfs_handle_t *, int *);