Friday, September 16, 2005

delete a file on logging UFS

When you delete a file on logging UFS, the file and its allocated
resources are not freed immediately, what happens is that the
directory entry gets zapped and the inode is put onto a so called
delete queue and the delete thread will run from time to time
to drain the queue (also on umount and lockfs -f requests).

when the delete queue gets drained, the inode and its allocated
resources are freed, this is done within a transaction in case
of logging and as part of this delete transaction the allocated
blocks are freed as well, but are not immediately available
for re-use as long as the whole transaction is not committed
to the log.

this does not mean that a log roll must happen to be able
to re-use those blocks, committing the entire transaction
to the log makes them available for new allocations.

if you run out of space UFS will detect a possible ENOSPC failure
and will forcibly drain the delete queue in this case to
free up any resources still lurking around in the delete queue
and re-do the allocation attempt before eventually
failing with ENOSPC.


Post a Comment

<< Home