home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / linux / 20953 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.5 KB  |  43 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!mcsun!news.funet.fi!hydra!klaava!torvalds
  3. From: torvalds@klaava.Helsinki.FI (Linus Torvalds)
  4. Subject: Re: [Q] Does Linux fs hate large Directories?
  5. Message-ID: <1992Dec18.104429.5803@klaava.Helsinki.FI>
  6. Organization: University of Helsinki
  7. References: <1992Dec14.124205.417@camaro>
  8. Date: Fri, 18 Dec 1992 10:44:29 GMT
  9. Lines: 32
  10.  
  11. In article <1992Dec14.124205.417@camaro> tfoley@camaro (Tim Foley) writes:
  12. >
  13. >   Does Linux 0.98p1 have a problem with large directories?  
  14.  
  15. I already replied to Tim, but I thought I'd mention it publicly as well:
  16. yes, linux 0.99 (as well as all earlier versions) have problems with
  17. directories that contain many subdirectories.  The reason is simple: the
  18. minix filesystem uses only a unsigned char for the nlinks field, so if
  19. you create a lot of directories, nlinks will overflow, as it's not
  20. checked for.  The solution is either to use the extended filesystem
  21. (which uses unsigned shorts) or to live with the limitation that you
  22. can't have more than about 250 subdirectories in the same directory. 
  23.  
  24. Here is a patche to make the kernel check it (easy enough..): apply by
  25. hand to linux/fs/minix/namei.c, beginning of the minix_mkdir() function. 
  26.  
  27. ----- pseudo-patch -----
  28.           iput(dir);
  29.           return -EEXIST;
  30.       }
  31. +     if (dir->i_nlink > 250) {
  32. +         iput(dir);
  33. +         return -EMLINK;
  34. +     }
  35.       inode = minix_new_inode(dir);
  36.       if (!inode) {
  37. ----- pseudo-patch -----
  38.  
  39. Alternatively, wait until Sunday, when I'll make 0.99.1 available for
  40. final testing before 1.0.
  41.  
  42.         Linus
  43.