Figure 1 shows the typical writing process in an LFS. Data blocks and inode blocks are first assembled in a segment buffer to form a large log. When the segment buffer is full, the entire buffer is written to a disk segment in a single large disk write. If LFS has synchronous operations or if dirty data in the log have not been written for 30 seconds, partially full segments will be written to the disk. When some of the files are updated or deleted later, the previous blocks of that file on the disk are invalidated correspondingly. These invalidated blocks become holes in disk segments and have to be reclaimed by the garbage collection process.
The problem with LFS is that the system does not distinguish active data (namely short-lived data) from inactive data (namely long-lived data) in the write buffer. Data are simply grouped into a segment buffer randomly, mostly according to their arrival order. The buffer is then written to a disk segment when it is full. Within the segment, however, some data are active and will be quickly overwritten (therefore invalidated), while others are inactive and will remain on the disk for a relatively long period. The result is that the garbage collector has to compact the segment to eliminate the holes in order to reclaim the disk space.