backfs icon indicating copy to clipboard operation
backfs copied to clipboard

Infinite loop caused by cache disk space reserved for root

Open wfraser opened this issue 11 years ago • 0 comments

To reproduce:

  1. Make a cache filesystem image using ext2 with default parameters, and mount the cache somewhere like normal.
  2. Run backfs as a non-root user, using the cache fs, and specifying to use the whole cache device (which is the default)
  3. Fill the cache by loading files.

Ext2 and friends reserve a small percentage of space for UID 0 (root). What happens is, the cache filesystem fills up with non-root owned files, to the point where only the space reserved is left. backfs chokes on this as make_space_available looks at how much space is available, sees that there is plenty, and does nothing. This causes cache_add to go into an infinite loop inside while (bytes_written != len).

A temporary workaround is to either create the cache with no reserve space by passing -m 0 to mkfs.ext2, or by running backfs as root.

wfraser avatar Oct 23 '13 20:10 wfraser