[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20061228.145038.71089607.davem@davemloft.net>
Date: Thu, 28 Dec 2006 14:50:38 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: torvalds@...l.org
Cc: akpm@...l.org, guichaz@...oo.fr, ranma@...edrich.de,
gordonfarquharson@...il.com, mh+linux-kernel@...schlus.de,
nickpiggin@...oo.com.au, andrei.popa@...eo.ro,
linux-kernel@...r.kernel.org, a.p.zijlstra@...llo.nl,
hugh@...itas.com, fw@...eb.enyo.de, tbm@...ius.com,
arjan@...radead.org, kenneth.w.chen@...el.com
Subject: Re: 2.6.19 file content corruption on ext3
From: Linus Torvalds <torvalds@...l.org>
Date: Thu, 28 Dec 2006 14:37:37 -0800 (PST)
> So if we're not losing any dirty bits, what's going on?
What happens when we writeback, to the PTEs?
page_mkclean_file() iterates the VMAs and when it finds a shared
one it goes:
entry = ptep_clear_flush(vma, address, pte);
entry = pte_wrprotect(entry);
entry = pte_mkclean(entry);
and that's fine, but that PTE is still marked writable, and
I think that's key.
What does the fault path do in this situation?
if (write_access) {
if (!pte_write(entry))
return do_wp_page(mm, vma, address,
pte, pmd, ptl, entry);
entry = pte_mkdirty(entry);
}
It does nothing to update the page dirty state, because it's
writable, it just sets the PTE dirty bit and that's it. Should
it be setting the page dirty here for SHARED cases?
So until vmscan actually unmaps the PTE completely, we have this
window in which the application can write to the PTE and the
page dirty state doesn't get updated.
Perhaps something later cleans up after this, f.e. by rechecking the
PTE dirty bit at the end of I/O or when vmscan unmaps the page.
I guess that should handle things, but the above logic definitely
stood out to me.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists