[FreeBSD] fix false assert in cache_vop_rmdir when replaying ZIL

The assert is enabled when DEBUG_VFS_LOCKS kernel option is set.
The exact panic is:
    panic: condition seqc_in_modify(_vp->v_seqc) not met
It happens because seqc protocol is not followed for ZIL replay.

But we actually do not need to make any namecache calls at that stage,
because the namecache use is not enabled until after the replay is
completed.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Andriy Gapon <avg@FreeBSD.org>
Closes #14566
This commit is contained in:
Andriy Gapon 2023-03-07 23:48:43 +02:00 committed by GitHub
parent 1191387012
commit a55254be7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1624,6 +1624,7 @@ zfs_rmdir_(vnode_t *dvp, vnode_t *vp, const char *name, cred_t *cr)
dmu_tx_commit(tx); dmu_tx_commit(tx);
if (zfsvfs->z_use_namecache)
cache_vop_rmdir(dvp, vp); cache_vop_rmdir(dvp, vp);
out: out:
if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS)