git: 1959e122d932 - main - zfs: Merge https://github.com/openzfs/zfs/pull/14739

From: Pawel Jakub Dawidek <pjd_at_FreeBSD.org>
Date: Mon, 17 Apr 2023 09:25:20 UTC
The branch main has been updated by pjd:

URL: https://cgit.FreeBSD.org/src/commit/?id=1959e122d9328b31a62ff7508e1746df2857b592

commit 1959e122d9328b31a62ff7508e1746df2857b592
Author:     Pawel Jakub Dawidek <pjd@FreeBSD.org>
AuthorDate: 2023-04-17 09:22:56 +0000
Commit:     Pawel Jakub Dawidek <pjd@FreeBSD.org>
CommitDate: 2023-04-17 09:22:56 +0000

    zfs: Merge https://github.com/openzfs/zfs/pull/14739
    
    The zfs_log_clone_range() function is never called from the
    zfs_clone_range_replay() function, so I assumed it is safe to assert
    that zil_replaying() is never TRUE here. It turns out zil_replaying()
    also returns TRUE when the sync property is set to disabled.
    
    Fix the problem by just returning if zil_replaying() returns TRUE.
    
    Reported by: Florian Smeets
    Signed-off-by: Pawel Jakub Dawidek pawel@dawidek.net
    
    Approved by: oshogbo, mm
---
 sys/contrib/openzfs/module/zfs/zfs_log.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sys/contrib/openzfs/module/zfs/zfs_log.c b/sys/contrib/openzfs/module/zfs/zfs_log.c
index d009c58d8644..50325907b0d1 100644
--- a/sys/contrib/openzfs/module/zfs/zfs_log.c
+++ b/sys/contrib/openzfs/module/zfs/zfs_log.c
@@ -905,9 +905,7 @@ zfs_log_clone_range(zilog_t *zilog, dmu_tx_t *tx, int txtype, znode_t *zp,
 	uint64_t partlen, max_log_data;
 	size_t i, partnbps;
 
-	VERIFY(!zil_replaying(zilog, tx));
-
-	if (zp->z_unlinked)
+	if (zil_replaying(zilog, tx) || zp->z_unlinked)
 		return;
 
 	max_log_data = zil_max_log_data(zilog, sizeof (lr_clone_range_t));