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

Corrupted atimes #15762

Closed
ossimoi opened this issue Jan 12, 2024 · 1 comment · Fixed by #15773
Closed

Corrupted atimes #15762

ossimoi opened this issue Jan 12, 2024 · 1 comment · Fixed by #15773
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@ossimoi
Copy link

ossimoi commented Jan 12, 2024

System information

Type Version/Name
Distribution Name Gentoo
Distribution Version 2.14
Kernel Version 6.6.11
Architecture x86_64
OpenZFS Version 2.2.99-288_ga382e2119

Describe the problem you're observing

touching a file corrupts its atime.

# echo test > test  
# ls -lu
-rw-r--r-- 1 root root 5 Jan 12 05:01 test
# touch test
# ls -lu
-rw-r--r-- 1 root root 5 -72340172838076674 test
# stat -c%x test
-72340172838076674.-16843010
# cat test
test
# ls -lu
-rw-r--r-- 1 root root 5 Jan 12 05:02 test

@ossimoi ossimoi added the Type: Defect Incorrect behavior (e.g. crash, hang) label Jan 12, 2024
robn added a commit to robn/zfs that referenced this issue Jan 14, 2024
In db4fc55 I messed up and changed this bit of code to set the inode
atime to uninitialised value, when actually it was just supposed to be
an atime load. This changes it to what it should have been.

Signed-off-by: Rob Norris <[email protected]>
Fixes: openzfs#15762
robn added a commit to robn/zfs that referenced this issue Jan 14, 2024
In db4fc55 I messed up and changed this bit of code to set the inode
atime to uninitialised value, when actually it was just supposed to be
an atime load. This changes it to what it should have been.

Signed-off-by: Rob Norris <[email protected]>
Sponsered-by: https://despairlabs.com/sponsor/
Fixes: openzfs#15762
robn added a commit to robn/zfs that referenced this issue Jan 14, 2024
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]>
Sponsered-by: https://despairlabs.com/sponsor/
Fixes: openzfs#15762
robn added a commit to robn/zfs that referenced this issue Jan 14, 2024
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]>
Sponsered-by: https://despairlabs.com/sponsor/
Fixes: openzfs#15762
@robn
Copy link
Member

robn commented Jan 14, 2024

@ossimoi thanks for reporting this! My stupid mistake. Fixes posted in #15773 and #15774.

snajpa pushed a commit to vpsfreecz/zfs that referenced this issue Jan 14, 2024
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]>
Sponsered-by: https://despairlabs.com/sponsor/
Fixes: openzfs#15762
Signed-off-by: Pavel Snajdr <[email protected]>
robn added a commit to robn/zfs that referenced this issue Jan 14, 2024
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]>
Sponsered-by: https://despairlabs.com/sponsor/
Fixes: openzfs#15762
robn added a commit to robn/zfs that referenced this issue Jan 14, 2024
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]>
Sponsered-by: https://despairlabs.com/sponsor/
Fixes: openzfs#15762
robn added a commit to robn/zfs that referenced this issue Jan 14, 2024
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
robn added a commit to robn/zfs that referenced this issue Jan 14, 2024
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
ixhamza pushed a commit to truenas/zfs that referenced this issue Jan 15, 2024
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
behlendorf pushed a commit that referenced this issue Jan 16, 2024
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
robn added a commit to robn/zfs that referenced this issue Jan 16, 2024
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
ixhamza pushed a commit to truenas/zfs that referenced this issue Jan 17, 2024
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
behlendorf pushed a commit that referenced this issue Jan 17, 2024
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
stgraber pushed a commit to zabbly/zfs that referenced this issue Jan 24, 2024
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
robn added a commit to robn/zfs that referenced this issue Feb 7, 2024
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)
tonyhutter pushed a commit that referenced this issue Feb 8, 2024
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)
lundman pushed a commit to openzfsonwindows/openzfs that referenced this issue Mar 13, 2024
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
lundman pushed a commit to openzfsonwindows/openzfs that referenced this issue Mar 13, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants