freebsd-dev/cddl/contrib/opensolaris/cmd
Mark Johnston 4cbba6ae24 MFOpenZFS: 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 <tcaputi@datto.com>
Reviewed-by: Matt Ahrens <matt@delphix.com>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@nutanix.com>
Closes #9516

Note, this change changes the libzfs.so ABI by modifying the prototype
of zpool_get_history().  Since libzfs is effectively private to the base
system it is anticipated that this will not be a problem.

PR:		247557
Obtained from:	OpenZFS
Reported and tested by:	Sam Vaughan <samjvaughan@gmail.com>
Discussed with:	freqlabs
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D25745
openzfs/zfs@7125a109dc
2020-07-23 14:21:45 +00:00
..
dtrace Add HISTORY sections to ZFS and dtrace manpage 2020-06-14 05:50:28 +00:00
lockstat Add HISTORY sections to ZFS and dtrace manpage 2020-06-14 05:50:28 +00:00
mdb/tools/common Mechanically convert cddl sun #ifdef's to illumos 2015-01-17 14:44:59 +00:00
plockstat Fix the build for non-amd64. 2015-12-02 02:11:38 +00:00
pyzfs
stat/common
zdb Add HISTORY sections to ZFS and dtrace manpage 2020-06-14 05:50:28 +00:00
zfs MFOpenZFS: Add basic zfs ioc input nvpair validation 2020-06-23 06:42:39 +00:00
zhack MFV r354378,r354379,r354386: 10499 Multi-modifier protection (MMP) 2019-11-18 09:38:35 +00:00
zinject MFV r296505: 6531 Provide mechanism to artificially limit disk performance 2016-03-08 17:27:13 +00:00
zlook
zpool MFOpenZFS: Fix zpool history unbounded memory usage 2020-07-23 14:21:45 +00:00
zstreamdump Add HISTORY sections to ZFS and dtrace manpage 2020-06-14 05:50:28 +00:00
ztest MFOpenZFS: make zil max block size tunable 2020-03-19 01:05:54 +00:00