-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Asynchronous deletes don't work #7994
Comments
My initial thoughts for a fix is to refactor I'll also note that it seems as if the |
@dweeezil I may be overlooking something from the description but it sounds as if the fix could be as straight forward and not checking the |
@behlendorf You're correct, we can probably remove all of that handling from |
This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions. |
System information
Describe the problem you're observing
Deletes which should be asynchronous are not.
Describe how to reproduce the problem
Delete a file containing more blocks than the
zfs_delete_blocks
setting and observe control flow via either kernel or ZFS module instrumentation.Include any warning/errors/backtraces from the system logs
N/A
Background
The
zfs_delete_blocks
, which was introduced via 6ca1fab in #4259 is supposed to allow for asynchronous deletes of large files in order that the various unlink system calls not block while the freeing takes place.Cause of problem
The logic in
zfs_remove()
which determines whether a file can be removed "now" and whether it should be deleted asynchronously is not compatible with the handling of inode reference counts (i_count
).In the
do_unlinkat()
path, as used by a typicalrm
command, an extra reference is taken prior to callingvfs_unlink()
. Then, inzfs_remove()
, thezfs_zget()
causes yet another reference to be taken. As a result, the minimum reference count on this path is 3 prior to examining the count to determine synchronicity.In the typical NFS path, in which, the same
zfs_zget()
causes the reference count to typically be 2.Neither path allow the logic in
zfs_remove()
, which depends on the reference being 1 (i.e. "allocated in the icache with no additional references), to work properly.The text was updated successfully, but these errors were encountered: