/* raidtest - a program to integritytest a Linux software raid Copyright (C) 2005 Kasper Dupont This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or with permission from the author any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA $Id: $ */ #include #include #include #include #include void errstop(const char *s) { perror(s); exit(EXIT_FAILURE); } void formaterror() { fprintf(stderr,"Unexpected format in /proc/mdstat\n"); exit(EXIT_FAILURE); } #define MAXDEV 99 int fds[MAXDEV]; char buffers[MAXDEV][1024]; void testit(int mdnum, int level, int blocks, int devices, char *devnames) { int i,b; //printf("md%d raid%d %d blocks %d devices\n",mdnum,level,blocks,devices); if (level==5) { int d=devices-1; if (blocks % d) { fprintf(stderr,"md%d: %d not divisible by %d\n",mdnum,blocks,d); return; } blocks/=d; } for (i=0;i1) && (devup