-
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
zfs_setattr: fix atime update #15773
Conversation
Can you, pretty please, add a test (to this PR or later) so this doesn't happen again? I'd love to buy you a beer if you do, btw :D (PM me how can I do that if you're up for it ;)) |
07c7932
to
bf73b95
Compare
Previously, we only checked if the times changed at all, which missed a bug where the atime was being set to an undefined value. Now ensure the times change by two seconds (or thereabouts), ensuring we catch cases where we set the time to something bonkers Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/
In db4fc55 I messed up and changed this bit of code to set the inode atime to an uninitialised value, when actually it was just supposed to loading the atime from the inode to be stored in the SA. This changes it to what it should have been. Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/ Fixes: openzfs#15762
bf73b95
to
34c12f7
Compare
@snajpa good call! Turns out there was a test checking the ctime/mtime/atime changes worked, but it was only checking that the times changed at all, not that they changed appropriately. So I've updated that to check for the expected value, and sure enough, it fails before this patch, succeeds after. Nice!
Well I'm not sure I deserve one after two rounds of stuff ups, but if you insist I won't say no! 😆 There's links in my Github bio, and/or let me know if you're ever in Melbourne. Cheers! 🍻 |
Thank you :)
Completely forgot GH added that feature, so didn't check before asking :D also about this:
I think you're doing good work, mishaps happen. FWIW, I think it perhaps might be a good idea to change stable policy to avoid leaking such problems to the wider userbase - to put a bit of a delay before backporting functionality enhancing patches to the stable; I think new Linux version compat is that, it isn't a fix, not compiling on newer Linux is a missing feature. New features sometimes break stuff :) |
I don't disagree in principle, but I do think there's a bit of a grey area and updates for newer kernels may fall into it. There are competing interests: people running bleeding-edge kernels are also the people more likely to experiment and test and offer feedback, so helping them out might be a bit of a force multiplier for us. There's also optics; keeping up with Linux helps to make sure we don't appear to be stagnating. And to be fair, this bug also beat two reviewers and the test suite, which is rare. I guess I'm saying that I can at least make an argument either way. Not that its my decision in the end, but I do support it. Appreciate the feedback, thank you :) |
@snajpa thanks for catching this and letting us know. Sorry it slipped by! Some good news here is that neither of the stable releases (2.1.14 or 2.2.2) include these Linux 6.7 compatibility changes yet. |
In db4fc55 I messed up and changed this bit of code to set the inode atime to an uninitialised value, when actually it was just supposed to loading the atime from the inode to be stored in the SA. This changes it to what it should have been. Ensure times change by the right amount Previously, we only checked if the times changed at all, which missed a bug where the atime was being set to an undefined value. Now ensure the times change by two seconds (or thereabouts), ensuring we catch cases where we set the time to something bonkers Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15762 Closes openzfs#15773
In db4fc55 I messed up and changed this bit of code to set the inode atime to an uninitialised value, when actually it was just supposed to loading the atime from the inode to be stored in the SA. This changes it to what it should have been. Ensure times change by the right amount Previously, we only checked if the times changed at all, which missed a bug where the atime was being set to an undefined value. Now ensure the times change by two seconds (or thereabouts), ensuring we catch cases where we set the time to something bonkers Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15762 Closes openzfs#15773
In db4fc55 I messed up and changed this bit of code to set the inode atime to an uninitialised value, when actually it was just supposed to loading the atime from the inode to be stored in the SA. This changes it to what it should have been. Ensure times change by the right amount Previously, we only checked if the times changed at all, which missed a bug where the atime was being set to an undefined value. Now ensure the times change by two seconds (or thereabouts), ensuring we catch cases where we set the time to something bonkers Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/ Closes #15762 Closes #15773
In db4fc55 I messed up and changed this bit of code to set the inode atime to an uninitialised value, when actually it was just supposed to loading the atime from the inode to be stored in the SA. This changes it to what it should have been. Ensure times change by the right amount Previously, we only checked if the times changed at all, which missed a bug where the atime was being set to an undefined value. Now ensure the times change by two seconds (or thereabouts), ensuring we catch cases where we set the time to something bonkers Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15762 Closes openzfs#15773
In db4fc55 I messed up and changed this bit of code to set the inode atime to an uninitialised value, when actually it was just supposed to loading the atime from the inode to be stored in the SA. This changes it to what it should have been. Ensure times change by the right amount Previously, we only checked if the times changed at all, which missed a bug where the atime was being set to an undefined value. Now ensure the times change by two seconds (or thereabouts), ensuring we catch cases where we set the time to something bonkers Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15762 Closes openzfs#15773 (cherry picked from commit 2ecc2df)
In db4fc55 I messed up and changed this bit of code to set the inode atime to an uninitialised value, when actually it was just supposed to loading the atime from the inode to be stored in the SA. This changes it to what it should have been. Ensure times change by the right amount Previously, we only checked if the times changed at all, which missed a bug where the atime was being set to an undefined value. Now ensure the times change by two seconds (or thereabouts), ensuring we catch cases where we set the time to something bonkers Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/ Closes #15762 Closes #15773 (cherry picked from commit 2ecc2df)
In db4fc55 I messed up and changed this bit of code to set the inode atime to an uninitialised value, when actually it was just supposed to loading the atime from the inode to be stored in the SA. This changes it to what it should have been. Ensure times change by the right amount Previously, we only checked if the times changed at all, which missed a bug where the atime was being set to an undefined value. Now ensure the times change by two seconds (or thereabouts), ensuring we catch cases where we set the time to something bonkers Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15762 Closes openzfs#15773
In db4fc55 I messed up and changed this bit of code to set the inode atime to an uninitialised value, when actually it was just supposed to loading the atime from the inode to be stored in the SA. This changes it to what it should have been. Ensure times change by the right amount Previously, we only checked if the times changed at all, which missed a bug where the atime was being set to an undefined value. Now ensure the times change by two seconds (or thereabouts), ensuring we catch cases where we set the time to something bonkers Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#15762 Closes openzfs#15773
Description
In db4fc55 I messed up and changed this bit of code to set the inode atime to an uninitialised value, when actually it was just supposed to loading the atime from the inode to be stored in the SA. This changes it to what it should have been.
Fixes: #15762
How Has This Been Tested?
By hand, on kernel 5.10.x and 6.4.x. At 00f4096 (ie
db4fc559c^
), correct behaviour:At db4fc55, and on master a1771d2 on 5.10.x, 6.4.x and 6.7.x:
With this patch:
[update]: existing ctime/mtime/atime modification test has been updated to check the update makes sense, not just that it was updated.
Types of changes
Checklist:
Signed-off-by
.