diff options
author | Brian Behlendorf <[email protected]> | 2015-02-05 17:00:05 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-02-06 09:24:28 -0800 |
commit | e2c4acde55931ae58d5bf5fd394567a96e942a5c (patch) | |
tree | d5f709c4c8dc01b99bb060c4bb6824a0115a5f91 /module/zfs | |
parent | aa506dcb3d2ec4a26d0e20854fa0bf370738a422 (diff) |
Skip evicting dbufs when walking the dbuf hash
When a dbuf is in the DB_EVICTING state it may no longer be on the
dn_dbufs list. In which case it's unsafe to call DB_DNODE_ENTER.
Therefore, any dbuf which is found in this safe must be skipped.
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #2553
Closes #2495
Diffstat (limited to 'module/zfs')
-rw-r--r-- | module/zfs/dbuf_stats.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/module/zfs/dbuf_stats.c b/module/zfs/dbuf_stats.c index 3b9c63d31..5e7eaf1ac 100644 --- a/module/zfs/dbuf_stats.c +++ b/module/zfs/dbuf_stats.c @@ -151,9 +151,11 @@ dbuf_stats_hash_table_data(char *buf, size_t size, void *data) mutex_enter(&db->db_mtx); mutex_exit(DBUF_HASH_MUTEX(h, dsh->idx)); - length = __dbuf_stats_hash_table_data(buf, size, db); - buf += length; - size -= length; + if (db->db_state != DB_EVICTING) { + length = __dbuf_stats_hash_table_data(buf, size, db); + buf += length; + size -= length; + } mutex_exit(&db->db_mtx); mutex_enter(DBUF_HASH_MUTEX(h, dsh->idx)); |