[vienna.pm] Fwd: Re: ReiserFS Bug beim anhДngen an kleine Dateien

Philipp G?hring p.guehring at poboxes.com
Thu May 24 15:17:25 CDT 2001


* * * vienna-pm-list * * *




----------  Weitergeleitete Nachricht  ----------
Subject: Re: ReiserFS Bug beim anhДngen an kleine Dateien
Date: Thu, 24 May 2001 11:02:14 -0700
From: Hans Reiser <reiser at namesys.com>
To: p.guehring at futureware.at


I strongly suspect this is a perl coding bug of some sort, can you post it to
the mailing list (reiserfs-list)?

I haven't worked with perl for a while, so I am not current on its buffering
issues, etc.

Hans

Philipp G?hring wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Am Donnerstag, 24. Mai 2001 19:20 schrieben Sie:
> > Can you resend in english?
>
> Sure.
>
> Hi!
>
> I created a batchjob, which converts a database. I have about 200.000
> records with about 10 kilobyte per record.
>
> It?s just one singular batch-job, so concurrent accesses or heavy load
> cannot be the problem.
>
> I am reading the records out of Cobol tables, and concatenate them with
> Perl into files.
>
> At first, I tried to do it the following way:
>
>      open (OUT,">>sta/$pkz") or die;
>        convert and write a part of the record
>      clouse OUT;
>
>      open (OUT,">>sta/$pkz") or die;
>        convert and write a part of the record
>      clouse OUT;
>
>      open (OUT,">>sta/$pkz") or die;
>        convert and write a part of the record
>      clouse OUT;
>
>      ...
>
> I do this about 10 times, so the whole file sums up to about 10 Kilobyte.
>
> The problem is that about one to ten percent of the files get corrupted.
> The first records are good. When for example the third records should be
> added to the file, a part of the file gets overwritten with Zeros (0x00),
> and the record gets added.
>
> I am thinking that it is a bug in ReiserFS, which happens when the file
> gets opened for attaching. As far as I know, ReiserFS puts several small
> files into one block, if they fit into it. I think for the first few
> records, the files are together in one block. But when they have to grow
> and get their own blocks, something goes wrong.
>
> I rewrote the code:
>
>      my @save;
>      open (OUT,"<sta/$pkz") and @save=<OUT> and close OUT;
>      open (OUT,">sta/$pkz") or die;
>      print OUT @save;
>      #Now write out the part of the record that gets added
>      close OUT;
>
> So the file is opened for read, read in, closed again; opened for
> overwriting, being written again, then the part to be attached gets
> written, and then it gets closed again.
> (Concatenating by hand)
>
> Which seems to be a working workaround for the problem.
>
> The only problem is the memory consumption and the performance problem the
> workaround generates.
>
> I am using ReiserFS from Kernel 2.2 and Kernel 2.4 which I got from the
> SuSE 7.1 (Intel architecture)
>
> I tried it on completely different machines (IDE vs. SCSI, Pentium 100 vs.
> Pentium 4/800, ...)
>
> The problem seems to be easily reconstructable.
>
> I hope this helps to find and remove the bug.
>
> Many greetings,
> - --
> ~ Philipp G?hring              p.guehring at futureware.at
> ~ http://www.futureware.at/       ICQ UIN: 6588261
> ~ "Hat du Abk?rzungen, mut du Futureware Translator nehmen!"
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.4 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
>
> iD8DBQE7DUnllqQ+F+0wB3oRAtuVAKCQbvYytKuZ06uXk9jIYoK79qEQ8ACfc+Ei
> wss53L5onKtuB4/1d89Oaks=
> =uRC1
> -----END PGP SIGNATURE-----

-------------------------------------------------------

-- 
~ Philipp G?hring              p.guehring at futureware.at
~ http://www.futureware.at/       ICQ UIN: 6588261
~ "Hat du Abk?rzungen, mut du Futureware Translator nehmen!"

###
You are subscribed to vienna-pm-list as Philipp G?hring <p.guehring at poboxes.com>
http://www.fff.at/fff/vienna.pm/



More information about the Vienna-pm mailing list