]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Skip evicting dbufs when walking the dbuf hash
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 6 Feb 2015 01:00:05 +0000 (17:00 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 6 Feb 2015 17:24:28 +0000 (09:24 -0800)
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 <behlendorf1@llnl.gov>
Closes #2553
Closes #2495

module/zfs/dbuf_stats.c

index 3b9c63d31efdbb96fd132df9d2853f83e858c815..5e7eaf1acf33083d8c8a66efdc883dd8ec359cd1 100644 (file)
@@ -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));