diff options
author | Matthew Macy <[email protected]> | 2020-09-01 16:16:56 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2020-09-01 16:16:56 -0700 |
commit | e84e49218f448369929c5c426220445d1698f044 (patch) | |
tree | bbd73f9905f6302ea2034a8510950382353c51f2 /module/zfs/spa_stats.c | |
parent | 7b4e27232dec4595ef842ce7c0e31aafd255a20a (diff) |
FreeBSD: Fix up after spa_stats.c move
Moving spa_stats added the additional burden of supporting
KSTAT_TYPE_IO.
spa_state_addr will always return a valid value regardless of
the value of 'n'. On FreeBSD this will cause an infinite loop
as it relies on the raw ops addr routine to indicate that there
is no more data.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Matt Macy <[email protected]>
Closes #10860
Diffstat (limited to 'module/zfs/spa_stats.c')
-rw-r--r-- | module/zfs/spa_stats.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/module/zfs/spa_stats.c b/module/zfs/spa_stats.c index 86cefa6dd..5c1073c14 100644 --- a/module/zfs/spa_stats.c +++ b/module/zfs/spa_stats.c @@ -835,7 +835,9 @@ spa_mmp_history_add(spa_t *spa, uint64_t txg, uint64_t timestamp, static void * spa_state_addr(kstat_t *ksp, loff_t n) { - return (ksp->ks_private); /* return the spa_t */ + if (n == 0) + return (ksp->ks_private); /* return the spa_t */ + return (NULL); } static int |