mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* quota deadlock
@ 2004-11-12 17:31 stanojr
  2004-11-15 12:20 ` Jan Kara
  2004-11-30  0:18 ` Andrew Morton
  0 siblings, 2 replies; 5+ messages in thread
From: stanojr @ 2004-11-12 17:31 UTC (permalink / raw)
  To: linux-kernel

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-11-30 12:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-12 17:31 quota deadlock stanojr
2004-11-15 12:20 ` Jan Kara
2004-11-15 13:46   ` stanojr
2004-11-30  0:18 ` Andrew Morton
2004-11-30 12:48   ` stanojr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®