From 8e556c5ebc7b66caf2cdcc561b6644f9f8437a6d Mon Sep 17 00:00:00 2001 From: Chunwei Chen Date: Tue, 13 Aug 2019 20:21:27 -0700 Subject: Fix out-of-order ZIL txtype lost on hardlinked files We should only call zil_remove_async when an object is removed. However, in current implementation, it is called whenever TX_REMOVE is called. In the case of hardlinked file, every unlink will generate TX_REMOVE and causing operations to be dropped even when the object is not removed. We fix this by only calling zil_remove_async when the file is fully unlinked. Reviewed-by: George Wilson Reviewed-by: Brian Behlendorf Reviewed-by: Prakash Surya Signed-off-by: Chunwei Chen Closes #8769 Closes #9061 --- include/sys/zfs_znode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/sys') diff --git a/include/sys/zfs_znode.h b/include/sys/zfs_znode.h index ef53684f7..a0a3dd1ad 100644 --- a/include/sys/zfs_znode.h +++ b/include/sys/zfs_znode.h @@ -371,7 +371,7 @@ extern void zfs_log_create(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, extern int zfs_log_create_txtype(zil_create_t, vsecattr_t *vsecp, vattr_t *vap); extern void zfs_log_remove(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, - znode_t *dzp, char *name, uint64_t foid); + znode_t *dzp, char *name, uint64_t foid, boolean_t unlinked); #define ZFS_NO_OBJECT 0 /* no object id */ extern void zfs_log_link(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, znode_t *dzp, znode_t *zp, char *name); -- cgit v1.2.3