More filesystem corruption under 2.4.1-pre8 and SW Raid5

Holger Kiehl (Holger.Kiehl@dwd.de)
Fri, 19 Jan 2001 08:47:23 +0100 (CET)


This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.

--646811434-3072538-979890443=:28348
Content-Type: TEXT/PLAIN; charset=US-ASCII

Hello

Trying to find a quick way to reproduce the filesystem corruption
I reported earlier, I have written a short program that simply creates
a certain number of files in a given directory. Now if I start this
program 9 times each creating 50000 files (each 2048 Bytes) in 9
different directories and then delete these files again I always get
filesystem corruption.

I admit that creating 50000 files in one directory is not something
very common, but in my other test there are simply to many process
creating and deleting files and took too long to reproduce. My
assumption is that something goes wrong somewhere as soon as a
certain number files have been created.

The test where done on two different machines both SMP, SW Raid 5
and ext2 filesystem. Under 2.4.1-pre3 and pre8 I always get filesystem
corruption. This does NOT happen under 2.2.18.

I don't know if this is due to a problem in the Raid 5, ext2 filesystem
or in the kernel. Also, I do not currently have a system with 2.4.x
without raid5. For this reason I have attached two files (one C program
and a script) with the code that corrupts my filesystem. To run it you
need to issue the following commands:

cc -o fsd fsd.c
mkdir testdir
cp fsd start_fsd testdir
cd testdir
chmod 755 start_fsd
./start_fsd

now you need to wait 3 or 4 hours and you should see some
ext2 errors in your syslog.

WARNING: This corrupts you filesystem really badly! Sometimes
only the files in the testdir are effected. However, I
had cases where other files where also effected. The
system sometimes behaves very strangely after the test,
programs that always have worked just crash. Reconstruction
with fsck does not always work properly, sometimes there are
very strange files scattered over the whole filesystem
afterwards. So be warned, do this on a test filesystem and boot
the machine after the test!

Another thing I notice is that the responsiveness of the machine
decreases dramatically as the test progresses until it is nearly
useless. After the test is done everything is back to normal.
The same behavior was observed under 2.2.18.

Holger

--646811434-3072538-979890443=:28348
Content-Type: TEXT/plain; name="fsd.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.30.0101190847230.28348@talentix.dwd.de>
Content-Description:
Content-Disposition: attachment;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iAod3JpdGUoZmQsICIiLCAxKSAhPSAxKQ0KICAgICAgew0KICAg
ICAgICAgKHZvaWQpZnByaW50ZihzdGRlcnIsICJGYWlsZWQgdG8gd3JpdGUo
KSB0byAlcyA6ICVzXG4iLA0KICAgICAgICAgICAgICAgICAgICAgICBkaXJu
YW1lLCBzdHJlcnJvcihlcnJubykpOw0KICAgICAgICAgZXhpdCgxKTsNCiAg
ICAgIH0NCiAgICAgIGlmIChjbG9zZShmZCkgPT0gLTEpDQogICAgICB7DQog
ICAgICAgICAodm9pZClmcHJpbnRmKHN0ZGVyciwgIkZhaWxlZCB0byBjbG9z
ZSgpICVzIDogJXNcbiIsDQogICAgICAgICAgICAgICAgICAgICAgIGRpcm5h
bWUsIHN0cmVycm9yKGVycm5vKSk7DQogICAgICB9DQogICB9DQogICBwdHJb
LTFdID0gMDsNCiAgIHJldHVybjsNCn0NCg0KDQovKisrKysrKysrKysrKysr
KysrKysrKysrKysrKysgZGVsZXRlX2ZpbGVzICsrKysrKysrKysrKysrKysr
KysrKysrKysrKysrKi8NCnN0YXRpYyB2b2lkDQpkZWxldGVfZmlsZXMoY2hh
ciAqZGlybmFtZSkNCnsNCiAgIGNoYXIgICAgICAgICAgKnB0cjsNCiAgIHN0
cnVjdCBkaXJlbnQgKmRpcnA7DQogICBESVIgICAgICAgICAgICpkcDsNCg0K
ICAgcHRyID0gZGlybmFtZSArIHN0cmxlbihkaXJuYW1lKTsNCiAgIGlmICgo
ZHAgPSBvcGVuZGlyKGRpcm5hbWUpKSA9PSBOVUxMKQ0KICAgew0KICAgICAg
KHZvaWQpZnByaW50ZihzdGRlcnIsICJGYWlsZWQgdG8gb3BlbmRpcigpICVz
IDogJXNcbiIsDQogICAgICAgICAgICAgICAgICAgIGRpcm5hbWUsIHN0cmVy
cm9yKGVycm5vKSk7DQogICAgICBleGl0KDEpOw0KICAgfQ0KICAgKnB0cisr
ID0gJy8nOw0KICAgd2hpbGUgKChkaXJwID0gcmVhZGRpcihkcCkpICE9IE5V
TEwpDQogICB7DQogICAgICBpZiAoZGlycC0+ZF9uYW1lWzBdICE9ICcuJykN
CiAgICAgIHsNCiAgICAgICAgICh2b2lkKXN0cmNweShwdHIsIGRpcnAtPmRf
bmFtZSk7DQogICAgICAgICBpZiAodW5saW5rKGRpcm5hbWUpID09IC0xKQ0K
ICAgICAgICAgew0KICAgICAgICAgICAgKHZvaWQpZnByaW50ZihzdGRlcnIs
ICJGYWlsZWQgdG8gb3BlbigpICVzIDogJXNcbiIsDQogICAgICAgICAgICAg
ICAgICAgICAgICAgIGRpcm5hbWUsIHN0cmVycm9yKGVycm5vKSk7DQogICAg
ICAgICAgICBleGl0KDEpOw0KICAgICAgICAgfQ0KICAgICAgfQ0KICAgfQ0K
ICAgcHRyWy0xXSA9IDA7DQogICBpZiAoY2xvc2VkaXIoZHApID09IC0xKQ0K
ICAgew0KICAgICAgKHZvaWQpZnByaW50ZihzdGRlcnIsICJGYWlsZWQgdG8g
Y2xvc2VkaXIoKSAlcyA6ICVzXG4iLA0KICAgICAgICAgICAgICAgICAgICBk
aXJuYW1lLCBzdHJlcnJvcihlcnJubykpOw0KICAgfQ0KICAgcmV0dXJuOw0K
fQ0K
--646811434-3072538-979890443=:28348
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=start_fsd
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.30.0101190847231.28348@talentix.dwd.de>
Content-Description:
Content-Disposition: attachment; filename=start_fsd

IyEvYmluL3NoDQoNCk5PX09GX1BST0NFU1M9OQ0KTlVNQkVSX09GX0ZJTEVT
PTUwMDAwDQpGSUxFX1NJWkU9MjA0OA0KDQpjb3VudGVyPTANCndoaWxlIFsg
JGNvdW50ZXIgLWx0ICROT19PRl9QUk9DRVNTIF0NCmRvDQogICBpZiBbICEg
LWQgJGNvdW50ZXIgXQ0KICAgdGhlbg0KICAgICAgbWtkaXIgJGNvdW50ZXIN
CiAgIGZpDQogICAuL2ZzZCAkTlVNQkVSX09GX0ZJTEVTICRGSUxFX1NJWkUg
JGNvdW50ZXIgJg0KICAgY291bnRlcj1gZXhwciAiJGNvdW50ZXIiICsgMWAN
CmRvbmUNCg==
--646811434-3072538-979890443=:28348--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/