fsck: Detect and correct stale or missing inode caches for object files
An easy way to see this in action is to have an unlocked file, and touch the object file. While all code that compares inode caches for object files needs to be prepared for this kind of problem and fall back to verification, having fsck notice it and correct it is cheap (as long as fsck is being run anyway) and ensures that if it happens for some unusual reason, there's a way for the user to notice that it's happening. Not that, when annex.thin is in use, the earlier call to isUnmodified (and also potentially earlier calls to inAnnex in eg, verifyLocationLog) will fix up the same problem silently. That might prevent the warning being displayed, although probably it still will be, because the Database.Keys write of the InodeCache will be queued but will not have happened yet. I can't see a way to improve this, but it's not great. Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
parent
817ccbbc47
commit
d2aead67bd
3 changed files with 58 additions and 2 deletions
|
@ -0,0 +1,19 @@
|
|||
[[!comment format=mdwn
|
||||
username="joey"
|
||||
subject="""comment 24"""
|
||||
date="2021-07-29T17:00:57Z"
|
||||
content="""
|
||||
I agree, fsck should notice and correct this problem. The current fix
|
||||
papers over the problem it in a way that will prevent users noticing it.
|
||||
Fsck being noisy about it will help avoid sweeping it under the rug and
|
||||
forgetting about it. Implemented that.
|
||||
|
||||
The performance impact here is relatively small. Aside from
|
||||
whenever this problem occurs, the extra checksumming will only happen when
|
||||
files are unlocked and the object file is modified. So annex.thin
|
||||
would need to be set and a file modified in a way that affects the object
|
||||
file. Several other parts of git-annex also checksum in that situation;
|
||||
that's a perf price you pay for using annex.thin. When this problem does
|
||||
occur, it will only checksum the object file once, and then will get its
|
||||
inode information cached.
|
||||
"""]]
|
Loading…
Add table
Add a link
Reference in a new issue