Other online diaries:
Martijn van Oosterhout,
Linux Weekly News,
Planet Linux Australia,
Archive by month:
Thu, 25 Sep 2008
Doing it backwards or unlink returning ENOSPC - 16:28
So this is not directly Linux related, however it is kind of
entertaining/strange. I have been mucking about with Solaris Logical Domains a
bit this week at work, as part of this I was reading up on how ZFS works. This
may well apply with LVM snap shots in Linux now also. However when reading
about out of space behaviour on ZFS with snapshots I was somewhat entertained
to see one specific point.
Due to the way snapshots work on ZFS there is a possibility you will get an
ENOSPC returned when trying to unlink (rm) a file. This is of course
completely reversed from the intuition most people will have, to free up space
remove some files. Out of curiosity I looked in the unlink man page on Linux
and in the rm source code on Linux, at a cursory glance neither of them will
deal with ENOSPC (unlink does not mention it as an error).
Without testing my guess is that in such a case unlink (2) would return EIO.