[Haiku-commits] r30960 - haiku/trunk/src/system/kernel/cache
ingo_weinhold at gmx.de
Fri Jun 5 16:24:07 CEST 2009
On 2009-06-05 at 14:51:28 [+0200], Stephan Aßmus <superstippi at gmx.de> wrote:
> Rene Gollent schrieb:
> > On Fri, Jun 5, 2009 at 7:03 AM, Stephan Aßmus<superstippi at gmx.de> wrote:
> >> So when I just move mails from one mail folder into the Trash, could
> >> that cause that folder to be "truncated" so that it could mess up data
> >> from another folder? Other than that, I don't see a "truncation"
> >> operation being involved at all in what I do to trigger the bug that
> >> mails disappear from one of my mail folders, so it's probably unrelated,
> >> correct?
> > Most likely unrelated. This particular bug as I understand it would
> > essentially be triggered as follows: Some file gets truncated to 0
> > bytes, and its storage is thus freed. Something else then winds up
> > getting allocated on the disk in the same spot where those file blocks
> > used to be, say, a B+ tree. Then due to the bug, the same blocks where
> > that directory was just written to get overwritten with some other
> > blocks. Presto, corrupted B+ tree. Requires a pretty specific set of
> > circumstances to trigger though, which sound completely different from
> > your disappearing email. Correct me if I'm wrong Axel :)
> So what happened if a program overwrites some file's contents, even if
> they end up being the same size or larger than before?
If opened with O_TRUNC -- which should be the case when overwriting -- it
would at least be truncated. Whether it uses the same space on disk
supposedly depends on BFS's allocation strategy. Axel certainly knows.
> Wouldn't that too
> start with a truncate operation depending on how you do it? What about
> attributes, were those affected in the same way? I don't really know if
> anything that Beam does could fit the situation.
Don't forget that Beam writes cache files for the folders. And those should
indeed shrink, when you move mails to the trash. Oliver will know how those
files are written (overwritten?).
More information about the Haiku-commits