quota deadlock

From: stanojr
Date: Fri Nov 12 2004 - 12:39:54 EST


dear developers,

my english sucks, so i'll be brief.
heavy write access to partition with quota enabled causes deadlock. if
processes try to access the deadlocked partition they
simply have no response and cannot be killed with SIGKILL. i've been
testing with reiserfs and ext2 on 2.6.9 kernel.

i made this little code to reproduce the problem:
--
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

int main(int ac,char *av[]) {
int procs,size,i;

procs=atoi(av[1]);
size=atoi(av[2]);

for(i=0;i<procs;i++) {
if (fork()==0) {
int fd;
char buf[65535];

setuid(i);
snprintf(buf,65535,"tmp/%d",i);
fd=open(buf,O_RDWR|O_CREAT|O_TRUNC|O_APPEND,S_IRWXU);
while (1) {
write(fd,buf,size);
}
}
}
}
--

use:
mkdir tmp;chmod 777 tmp;./a 20 4096
this creates 20 processes and every one has setuid to 0..20 trying to
write to tmp/0..20 4096k of crap in loop. after writing some MBs, all
processes just lock.

here is my task list dumped via sysrq and .config file from kernel
2.6.9
http://blackhole.websupport.sk/~stanojr/quotadeadlock/

stanojr
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/