-
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
Fix ENOSPC for extended quota #15312
Conversation
901832a
to
af99099
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for running this down. The fix itself looks good, just a nit about the test case.
af99099
to
9952207
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't looked very deep on the big picture, but it seems the "else" block of "ASSERT3U(used_on_disk, >=, quota)" after the "else if" is unreachable since #13839 and should be removed. The condition of the "if" is always true now.
9952207
to
38f73b6
Compare
@akashb-22 It is not the assertion, it is whole "else" is unreachable because "used_on_disk < quota" in "if" is always true. |
@amotin Yes, thanks for pointing this out. The entire "else" part is unreachable. I'll update it once I do a few more checks. |
When unlinking multiple files from a pool at 100% capacity, it was possible for ENOSPC to be returned after the first few unlinks. This issue was fixed previously by PR openzfs#13172 but then this was again introduced by PR openzfs#13839. This is resolved using the existing mechanism of returning ERESTART when over quota as long as we know enough space will shortly be available after processing the pending deferred frees. Also, updated the existing testcase which reliably reproduced the issue without this patch. Reviewed-by: Dipak Ghosh <[email protected]> Signed-off-by: Akash B <[email protected]>
38f73b6
to
719b1e6
Compare
When unlinking multiple files from a pool at 100% capacity, it was possible for ENOSPC to be returned after the first few unlinks. This issue was fixed previously by PR openzfs#13172 but then this was again introduced by PR openzfs#13839. This is resolved using the existing mechanism of returning ERESTART when over quota as long as we know enough space will shortly be available after processing the pending deferred frees. Also, updated the existing testcase which reliably reproduced the issue without this patch. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Dipak Ghosh <[email protected]> Signed-off-by: Akash B <[email protected]> Closes openzfs#15312
When unlinking multiple files from a pool at 100% capacity, it was possible for ENOSPC to be returned after the first few unlinks. This issue was fixed previously by PR #13172 but then this was again introduced by PR #13839. This is resolved using the existing mechanism of returning ERESTART when over quota as long as we know enough space will shortly be available after processing the pending deferred frees. Also, updated the existing testcase which reliably reproduced the issue without this patch. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Dipak Ghosh <[email protected]> Signed-off-by: Akash B <[email protected]> Closes #15312
When unlinking multiple files from a pool at 100% capacity, it was possible for ENOSPC to be returned after the first few unlinks. This issue was fixed previously by PR openzfs#13172 but then this was again introduced by PR openzfs#13839. This is resolved using the existing mechanism of returning ERESTART when over quota as long as we know enough space will shortly be available after processing the pending deferred frees. Also, updated the existing testcase which reliably reproduced the issue without this patch. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Dipak Ghosh <[email protected]> Signed-off-by: Akash B <[email protected]> Closes openzfs#15312
Motivation and Context
When unlinking multiple files from a pool at 100% capacity, it was possible for ENOSPC to be returned after the first few unlinks. This issue was fixed previously by PR #13172 but then, was again introduced by PR #13839. The intent of PR13839 is to have a quota limitation for the dataset by around 3%, So that the user can write more data than the quota is set and have more stable bandwidth, in the case we are overwriting data.
Looks like the same wasn't handled while the quota was exceeded and while having deferred frees.
Unluckily, this wasn't caught by the existing ZTS test case for some reason, but the same test failed when using small files for create/unlink /s at 100% fs capacity.
Reviewed-by: Dipak Ghosh [email protected]
Signed-off-by: Akash B [email protected]
Description
This is resolved using the existing mechanism of returning ERESTART when over quota as long as we know enough space will shortly be available after processing the pending deferred frees.
Also, updated the existing test case which reliably reproduces the issue without this patch.
How Has This Been Tested?
Test Reproducer:
Types of changes
Checklist:
Signed-off-by
.