]> git.proxmox.com Git - mirror_zfs.git/commit - include/sys/fs/zfs.h
Assertion failure when logging large output of channel program
authorMatthew Ahrens <matthew.ahrens@delphix.com>
Sat, 14 Nov 2020 18:17:16 +0000 (10:17 -0800)
committerGitHub <noreply@github.com>
Sat, 14 Nov 2020 18:17:16 +0000 (10:17 -0800)
commitd66aab7c081274c97b785cdc9033456c493ca6b1
treeffff201b4bf48631f0428e0d27b71229c829bb7e
parent7e3617de35defa931ec124d1442008f73b275ecc
Assertion failure when logging large output of channel program

The output of ZFS channel programs is logged on-disk in the zpool
history, and printed by `zpool history -i`.  Channel programs can use
10MB of memory by default, and up to 100MB by using the `zfs program -m`
flag.  Therefore their output can be up to some fraction of 100MB.

In addition to being somewhat wasteful of the limited space reserved for
the pool history (which for large pools is 1GB), in extreme cases this
can result in a failure of `ASSERT(length <= DMU_MAX_ACCESS);` in
`dmu_buf_hold_array_by_dnode()`.

This commit limits the output size that will be logged to 1MB.  Larger
outputs will not be logged, instead a entry will be logged indicating
the size of the omitted output.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #11194
cmd/zpool/zpool_main.c
include/sys/fs/zfs.h
man/man5/zfs-module-parameters.5
module/zfs/zfs_ioctl.c