Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet/dist/uts/common/fs/zfs Revert Rev. 1.63 ...



details:   https://anonhg.NetBSD.org/src/rev/d4bdb995c41a
branches:  trunk
changeset: 971867:d4bdb995c41a
user:      hannken <hannken%NetBSD.org@localhost>
date:      Thu May 07 09:12:03 2020 +0000

description:
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.

diffstat:

 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (23 lines):

diff -r b8f387c84228 -r d4bdb995c41a external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c    Thu May 07 00:55:13 2020 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c    Thu May 07 09:12:03 2020 +0000
@@ -5858,10 +5858,15 @@
                        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);



Home | Main Index | Thread Index | Old Index