mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 11:47:43 +03:00
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 <gwilson@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Prakash Surya <prakash.surya@delphix.com> Signed-off-by: Chunwei Chen <david.chen@nutanix.com> Closes #8769 Closes #9061
This commit is contained in:
committed by
Brian Behlendorf
parent
475ebd763a
commit
8e556c5ebc
@@ -1886,7 +1886,7 @@ top:
|
||||
txtype = TX_REMOVE;
|
||||
if (flags & FIGNORECASE)
|
||||
txtype |= TX_CI;
|
||||
zfs_log_remove(zilog, tx, txtype, dzp, name, obj);
|
||||
zfs_log_remove(zilog, tx, txtype, dzp, name, obj, unlinked);
|
||||
|
||||
dmu_tx_commit(tx);
|
||||
out:
|
||||
@@ -2219,7 +2219,8 @@ top:
|
||||
uint64_t txtype = TX_RMDIR;
|
||||
if (flags & FIGNORECASE)
|
||||
txtype |= TX_CI;
|
||||
zfs_log_remove(zilog, tx, txtype, dzp, name, ZFS_NO_OBJECT);
|
||||
zfs_log_remove(zilog, tx, txtype, dzp, name, ZFS_NO_OBJECT,
|
||||
B_FALSE);
|
||||
}
|
||||
|
||||
dmu_tx_commit(tx);
|
||||
|
||||
Reference in New Issue
Block a user