From: Brian Behlendorf Date: Fri, 6 Feb 2015 01:00:05 +0000 (-0800) Subject: Skip evicting dbufs when walking the dbuf hash X-Git-Tag: zfs-0.6.4~63 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e2c4acde55931ae58d5bf5fd394567a96e942a5c;p=zfs 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 Closes #2553 Closes #2495 --- 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));