From: Manfred Spraul <manfred@colorfullife.com>
To: Neil Brown <neilb@cse.unsw.edu.au>
Cc: Otto Meier <gf435@gmx.net>, Holger Kiehl <Holger.Kiehl@dwd.de>,
Hans Reiser <reiser@namesys.com>,
edward@namesys.com, Ed Tomlinson <tomlins@cam.org>,
Nils Rennebarth <nils@ipe.uni-stuttgart.de>,
David Willmore <n0ymv@callsign.net>,
Linus Torvalds <torvalds@transmeta.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org
Subject: Re: [PATCH] - filesystem corruption on soft RAID5 in 2.4.0+
Date: Sun, 21 Jan 2001 22:14:13 +0100 [thread overview]
Message-ID: <3A6B5125.6781E69D@colorfullife.com> (raw)
In-Reply-To: <14955.19182.663691.194031@notabene.cse.unsw.edu.au>
[-- Attachment #1: Type: text/plain, Size: 343 bytes --]
I've attached Holger's testcase (ext2, SMP, raid5)
boot with "mem=64M" and run the attached script.
The script creates and deletes 9 directories with 10.000 in each dir.
Neil, could you run it? I don't have an raid 5 array - SMP+ext2 without
raid5 is ok.
Holger, what's your ext2 block size, and do you run with a degraded
array?
--
Manfred
[-- Attachment #2: fsd.c --]
[-- Type: text/plain, Size: 2855 bytes --]
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
#include <errno.h>
static void create_files(int, int, char *),
delete_files(char *);
/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ fsd $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/
int
main(int argc, char *argv[])
{
int no_of_files,
file_size;
char dirname[1024];
if (argc == 4)
{
no_of_files = atoi(argv[1]);
file_size = atoi(argv[2]);
(void)strcpy(dirname, argv[3]);
}
else
{
(void)fprintf(stderr,
"Usage: %s <number of files> <file size> <directory>\n",
argv[0]);
exit(1);
}
create_files(no_of_files, file_size, dirname);
delete_files(dirname);
exit(0);
}
/*+++++++++++++++++++++++++++ create_files() ++++++++++++++++++++++++++++*/
static void
create_files(int no_of_files, int file_size, char *dirname)
{
int i, fd;
char *ptr;
ptr = dirname + strlen(dirname);
*ptr++ = '/';
for (i = 0; i < no_of_files; i++)
{
(void)sprintf(ptr, "this_is_dummy_file_%d", i);
if ((fd = open(dirname, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR)) == -1)
{
(void)fprintf(stderr, "Failed to open() %s : %s\n",
dirname, strerror(errno));
exit(1);
}
if (lseek(fd, file_size - 1, SEEK_SET) == -1)
{
(void)fprintf(stderr, "Failed to lseek() %s : %s\n",
dirname, strerror(errno));
exit(1);
}
if (write(fd, "", 1) != 1)
{
(void)fprintf(stderr, "Failed to write() to %s : %s\n",
dirname, strerror(errno));
exit(1);
}
if (close(fd) == -1)
{
(void)fprintf(stderr, "Failed to close() %s : %s\n",
dirname, strerror(errno));
}
}
ptr[-1] = 0;
return;
}
/*++++++++++++++++++++++++++++ delete_files +++++++++++++++++++++++++++++*/
static void
delete_files(char *dirname)
{
char *ptr;
struct dirent *dirp;
DIR *dp;
ptr = dirname + strlen(dirname);
if ((dp = opendir(dirname)) == NULL)
{
(void)fprintf(stderr, "Failed to opendir() %s : %s\n",
dirname, strerror(errno));
exit(1);
}
*ptr++ = '/';
while ((dirp = readdir(dp)) != NULL)
{
if (dirp->d_name[0] != '.')
{
(void)strcpy(ptr, dirp->d_name);
if (unlink(dirname) == -1)
{
(void)fprintf(stderr, "Failed to open() %s : %s\n",
dirname, strerror(errno));
exit(1);
}
}
}
ptr[-1] = 0;
if (closedir(dp) == -1)
{
(void)fprintf(stderr, "Failed to closedir() %s : %s\n",
dirname, strerror(errno));
}
return;
}
[-- Attachment #3: start_fsd --]
[-- Type: text/plain, Size: 261 bytes --]
#!/bin/sh
NO_OF_PROCESS=9
NUMBER_OF_FILES=10000
FILE_SIZE=2048
counter=0
while [ $counter -lt $NO_OF_PROCESS ]
do
if [ ! -d $counter ]
then
mkdir $counter
fi
./fsd $NUMBER_OF_FILES $FILE_SIZE $counter &
counter=`expr "$counter" + 1`
done
next prev parent reply other threads:[~2001-01-21 21:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-01-21 20:47 Neil Brown
2001-01-21 21:14 ` Manfred Spraul [this message]
2001-01-22 11:19 ` Holger Kiehl
2001-01-22 9:23 ` Hans Reiser
2001-01-22 19:36 ` Edward
2001-01-23 8:21 ` Holger Kiehl
2001-03-07 21:30 ` Kernel crash during resync of raid5 on SMP Otto Meier
2001-03-07 21:55 ` Neil Brown
2001-03-08 15:19 ` Otto Meier
2001-03-09 0:17 ` Neil Brown
2001-01-22 0:18 [PATCH] - filesystem corruption on soft RAID5 in 2.4.0+ Bernd Eckenfels
2001-01-22 6:37 ` Neil Brown
2001-01-22 18:09 Otto Meier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3A6B5125.6781E69D@colorfullife.com \
--to=manfred@colorfullife.com \
--cc=Holger.Kiehl@dwd.de \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=edward@namesys.com \
--cc=gf435@gmx.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=n0ymv@callsign.net \
--cc=neilb@cse.unsw.edu.au \
--cc=nils@ipe.uni-stuttgart.de \
--cc=reiser@namesys.com \
--cc=tomlins@cam.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome