Honour sync=disabled when relinking tpmfiles

Unlinked files don't respect synchronous flush commands, but when they get relinked
their state is unknown. Previously we force flushed all such files even when
sync=disabled. Correct this case.

Reviewed-by: Chunwei Chen <tuxoko@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: DHE <git@dehacked.net>
Closes #10005
This commit is contained in:
DeHackEd 2020-02-16 15:44:08 -05:00 committed by GitHub
parent ecbbdac799
commit d09dc5980c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4431,7 +4431,7 @@ top:
if (!is_tmpfile && zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS)
zil_commit(zilog, 0);
if (is_tmpfile)
if (is_tmpfile && zfsvfs->z_os->os_sync != ZFS_SYNC_DISABLED)
txg_wait_synced(dmu_objset_pool(zfsvfs->z_os), txg);
zfs_inode_update(tdzp);