Module Name: src
Committed By: hannken
Date: Thu May 7 09:12:03 UTC 2020
Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vnops.c
Log Message:
Revert Rev. 1.63 and add a comment why we have to zil_commit() here:
Operation zfs_znode.c::zfs_zget_cleaner() depends on this
zil_commit() as a barrier to guarantee the znode cannot
get freed before its log entries are resolved.
To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.64 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.65
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.64 Sat Mar 14 20:45:23 2020
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c Thu May 7 09:12:03 2020
@@ -5858,11 +5858,16 @@ zfs_netbsd_reclaim(void *v)
zp->z_atime_dirty = 0;
dmu_tx_commit(tx);
}
-
- if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS)
- zil_commit(zfsvfs->z_log, zp->z_id);
}
+ /*
+ * Operation zfs_znode.c::zfs_zget_cleaner() depends on this
+ * zil_commit() as a barrier to guarantee the znode cannot
+ * get freed before its log entries are resolved.
+ */
+ if (zfsvfs->z_log)
+ zil_commit(zfsvfs->z_log, zp->z_id);
+
if (zp->z_sa_hdl == NULL)
zfs_znode_free(zp);
else