Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zfs_rmnode() unlink / rollback issue #9739

Merged
merged 1 commit into from
Mar 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions module/os/linux/zfs/zfs_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -739,9 +739,15 @@ zfs_rmnode(znode_t *zp)
zfs_unlinked_add(xzp, tx);
}

/* Remove this znode from the unlinked set */
VERIFY3U(0, ==,
zap_remove_int(zfsvfs->z_os, zfsvfs->z_unlinkedobj, zp->z_id, tx));
/*
* Remove this znode from the unlinked set. If a has rollback has
* occurred while a file is open and unlinked. Then when the file
* is closed post rollback it will not exist in the rolled back
* version of the unlinked object.
*/
error = zap_remove_int(zfsvfs->z_os, zfsvfs->z_unlinkedobj,
zp->z_id, tx);
VERIFY(error == 0 || error == ENOENT);

dataset_kstats_update_nunlinked_kstat(&zfsvfs->z_kstat, 1);

Expand Down