title: Write one billion files in one Folder BUT "(No space left on device)" error
body: <p>I'm trying to write 1 billion of files in one folder using multi thread but next my program wrote 20 million files I got "No space left on device". I did not close my program because It still writing same files.</p>
  
  <ul>
  <li>I don't have any problems with "inode", I used only 7%.</li>
  <li>No problem with /tmp, /var/tmp, there are empty.</li>
  <li>I increased fs.inotify.max_user_watches to 1048576.</li>
  </ul>
  
  <p>I use debian and EXT4 as filesystem.
  Is there same one meet this problem and thank you so much for help.</p>
  
  <p>Running <code>tune2fs -l /path/to/drive</code> gives</p>
  
  <pre><code>Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
  
  Filesystem flags: signed_directory_hash
  
  Default mount options: user_xattr acl
  
  Filesystem state: clean
  
  Errors behavior: Continue
  
  Filesystem OS type: Linux
  
  Inode count: 260276224
  
  Block count: 195197952
  
  Reserved block count: 9759897
  
  Free blocks: 178861356
  
  Free inodes: 260276213
  
  First block: 0
  
  Block size: 4096
  
  Fragment size: 4096
  
  Reserved GDT blocks: 1024
  
  Blocks per group: 24576
  
  Fragments per group: 24576
  
  Inodes per group: 32768
  
  Inode blocks per group: 2048
  
  Flex block group size: 16
  
  Filesystem created: ---
  
  Last mount time: ---
  
  Last write time: ---
  
  Mount count: 2
  
  Maximum mount count: -1
  
  Last checked: ---
  
  Check interval: 0 ()
  
  Lifetime writes: 62 GB
  
  Reserved blocks uid: 0 (user root)
  
  Reserved blocks gid: 0 (group root)
  
  First inode: 11
  
  Inode size: 256
  
  Required extra isize: 28
  
  Desired extra isize: 28
  
  Journal inode: 8
  
  Default directory hash: ---
  
  Directory Hash Seed: ---
  
  Journal backup: inode blocks
  </code></pre>