borg icon indicating copy to clipboard operation
borg copied to clipboard

atime touched inside backup archive if there is no NOATIME support

Open ThomasWaldmann opened this issue 3 years ago • 3 comments

master branch: https://github.com/borgbackup/borg/blob/1.2.0b4/src/borg/testsuite/archiver.py#L534

this fails on cygwin. sto.st_atime_ns is newer than expected.

maybe this has to do with borg working fd-based now, so we open the files early and then do all file ops with the fd. if opening already touches the atime before we do the fstat(), this could be the consequence.

https://github.com/borgbackup/borg/blob/1.2.0b4/src/borg/archive.py#L1334

not super important maybe as borg 1.2 by default does not store the atime into an archive and other platforms do have NOATIME support.

ThomasWaldmann avatar Jan 29 '22 02:01 ThomasWaldmann

If someone wants to fix this:

Guess stat_update_check could contain a little hack by returning a stat_result object (or a look-alike) that has all from st_curr, except st_atime_ns which would come from st_old.

ThomasWaldmann avatar Jan 29 '22 02:01 ThomasWaldmann

are there other platforms without NOATIME support for os.open()?

ThomasWaldmann avatar Jan 29 '22 02:01 ThomasWaldmann

macOS Sonoma seems to not have os.O_NOATIME, but still test_atime succeeds (borg 1.2-maint and 1.4-maint).

So, either this is fixed or the windows test fail is due to something else.

ThomasWaldmann avatar Mar 07 '24 19:03 ThomasWaldmann