Date: Tue, 28 Nov 2023 21:06:28 GMT From: Martin Matuska <mm@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 99385ec7c296 - stable/14 - zfs: cherry-pick commit from master Message-ID: <202311282106.3ASL6Shl082208@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=99385ec7c2962c2b5e54161aca6ec57546229cb2 commit 99385ec7c2962c2b5e54161aca6ec57546229cb2 Author: Rob N <robn@despairlabs.com> AuthorDate: 2023-11-28 17:53:04 +0000 Commit: Martin Matuska <mm@FreeBSD.org> CommitDate: 2023-11-28 21:00:48 +0000 zfs: cherry-pick commit from master #15566 688514e47 dmu_buf_will_clone: fix race in transition back to NOFILL Obtained from: OpenZFS (cherry picked from commit 688514e4704bdee4551d25960febd322ac26f297) --- sys/contrib/openzfs/module/zfs/dbuf.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/contrib/openzfs/module/zfs/dbuf.c b/sys/contrib/openzfs/module/zfs/dbuf.c index f2831a0e8abf..5a7fe42b602a 100644 --- a/sys/contrib/openzfs/module/zfs/dbuf.c +++ b/sys/contrib/openzfs/module/zfs/dbuf.c @@ -2700,15 +2700,23 @@ dmu_buf_will_clone(dmu_buf_t *db_fake, dmu_tx_t *tx) * writes and clones into this block. */ mutex_enter(&db->db_mtx); + DBUF_VERIFY(db); VERIFY(!dbuf_undirty(db, tx)); ASSERT3P(dbuf_find_dirty_eq(db, tx->tx_txg), ==, NULL); if (db->db_buf != NULL) { arc_buf_destroy(db->db_buf, db); db->db_buf = NULL; + dbuf_clear_data(db); } + + db->db_state = DB_NOFILL; + DTRACE_SET_STATE(db, "allocating NOFILL buffer for clone"); + + DBUF_VERIFY(db); mutex_exit(&db->db_mtx); - dmu_buf_will_not_fill(db_fake, tx); + dbuf_noread(db); + (void) dbuf_dirty(db, tx); } void
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202311282106.3ASL6Shl082208>