diff options
author | George Wilson <[email protected]> | 2018-07-31 17:51:15 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2018-08-02 10:21:48 -0700 |
commit | 3d503a76e890d7711d5e906e025e092d0e244211 (patch) | |
tree | 3d82659f96cc5eb86b2c86589a59e70929c4ff83 /module/zfs/dbuf.c | |
parent | fd7265c646f40e364396af5014bbb83e809e124a (diff) |
Fix OpenZFS 9337 mismerge
This change reintroduces logic required by OpenZFS 9577. When
OpenZFS 9337, zfs get all is slow due to uncached metadata, was
merged in it ended up removing logic required by OpenZFS 9577,
remove zfs_dbuf_evict_key, and inadvertently reintroduced the
bug that 9577 was designed to fix.
This change re-enables the "evicting" flag to dbuf_rele_and_unlock
and dnode_rele_and_unlock and updates all callers to provide the
correct parameter.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: George Wilson <[email protected]>
Closes #7758
Diffstat (limited to 'module/zfs/dbuf.c')
-rw-r--r-- | module/zfs/dbuf.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c index dad090bf9..2724f3aa2 100644 --- a/module/zfs/dbuf.c +++ b/module/zfs/dbuf.c @@ -1212,7 +1212,7 @@ dbuf_read_done(zio_t *zio, const zbookmark_phys_t *zb, const blkptr_t *bp, db->db_state = DB_UNCACHED; } cv_broadcast(&db->db_changed); - dbuf_rele_and_unlock(db, NULL); + dbuf_rele_and_unlock(db, NULL, B_FALSE); } @@ -2580,7 +2580,7 @@ dbuf_destroy(dmu_buf_impl_t *db) * release any lock. */ mutex_enter(&dn->dn_mtx); - dnode_rele_and_unlock(dn, db); + dnode_rele_and_unlock(dn, db, B_TRUE); db->db_dnode_handle = NULL; dbuf_hash_remove(db); @@ -2609,7 +2609,7 @@ dbuf_destroy(dmu_buf_impl_t *db) */ if (parent && parent != dndb) { mutex_enter(&parent->db_mtx); - dbuf_rele_and_unlock(parent, db); + dbuf_rele_and_unlock(parent, db, B_TRUE); } } @@ -3351,7 +3351,7 @@ void dbuf_rele(dmu_buf_impl_t *db, void *tag) { mutex_enter(&db->db_mtx); - dbuf_rele_and_unlock(db, tag); + dbuf_rele_and_unlock(db, tag, B_FALSE); } void @@ -3374,7 +3374,7 @@ dmu_buf_rele(dmu_buf_t *db, void *tag) * */ void -dbuf_rele_and_unlock(dmu_buf_impl_t *db, void *tag) +dbuf_rele_and_unlock(dmu_buf_impl_t *db, void *tag, boolean_t evicting) { int64_t holds; @@ -3495,7 +3495,8 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, void *tag) } mutex_exit(&db->db_mtx); - if (db->db_caching_status == DB_DBUF_CACHE) { + if (db->db_caching_status == DB_DBUF_CACHE && + !evicting) { dbuf_evict_notify(); } } @@ -3848,7 +3849,7 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, dmu_tx_t *tx) kmem_free(dr, sizeof (dbuf_dirty_record_t)); ASSERT(db->db_dirtycnt > 0); db->db_dirtycnt -= 1; - dbuf_rele_and_unlock(db, (void *)(uintptr_t)txg); + dbuf_rele_and_unlock(db, (void *)(uintptr_t)txg, B_FALSE); return; } @@ -4223,7 +4224,7 @@ dbuf_write_done(zio_t *zio, arc_buf_t *buf, void *vdb) ASSERT(db->db_dirtycnt > 0); db->db_dirtycnt -= 1; db->db_data_pending = NULL; - dbuf_rele_and_unlock(db, (void *)(uintptr_t)tx->tx_txg); + dbuf_rele_and_unlock(db, (void *)(uintptr_t)tx->tx_txg, B_FALSE); } static void |