|
|
Log in / Subscribe / Register

A nasty file corruption bug - fixed

A nasty file corruption bug - fixed

Posted Jan 2, 2007 9:37 UTC (Tue) by kay (guest, #1362)
In reply to: A nasty file corruption bug - fixed by iabervon
Parent article: A nasty file corruption bug - fixed

The article may be a little confusing about this, but it states clear:

If the set_page_dirty() call comes while the I/O on the block is active, the filesystem will not notice the fact that the block's data may have changed after it was written

Kay


to post comments

A nasty file corruption bug - fixed

Posted Jan 2, 2007 18:34 UTC (Tue) by iabervon (subscriber, #722) [Link]

But I don't think that's actually true. If the I/O on the block is active, it has already cleared the bh's dirty bit (because the rule is that you clear dirty bits when you decide to write out data, not when you finish, to plug exactly the race you're talking about), and therefore set_page_dirty() will set it and things will be okay. I think this was Linus's second-to-last theory (something was cleaning a buffer after it sent the data to the disk), but it turned out not to be the problem.

The issue is if the page gets written out after set_page_dirty() but before the last write to the page, because the VM didn't redirty buffers in dirty pages when more writes came in. After getting the concurrent dirtying case correct, it essentially missed the case of writes to a clean part of a dirty page.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds