Closed rick-masters closed 7 months ago
Fiwix should allow removing directory as long as the resource (the directory in this case) is freed when its usage counter reaches zero.
I'll test it with a massive package build and I'll let you know the results.
After a complete package built I've not seen any problem with this change.
Also, I've confirmed that Fiwix correctly frees the space used by the removed directory as soon as no other process uses it:
[(root) ~]# df /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda2 1039752 663583 324182 68% /
[(root) ~]# mkdir testdir
[(root) ~]# cd testdir
[(root) ~/testdir]# df /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda2 1039752 663584 324181 68% /
[(root) ~/testdir]# rmdir ../testdir/
[(root) ~/testdir]# df /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda2 1039752 663584 324181 68% /
[(root) ~/testdir]# cd
[(root) ~]# df /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda2 1039752 663583 324182 68% /
[(root) ~]#
Thank you very much.
Linux allows removing a directory that is the current directory for a running process:
Fiwix does not:
This issue causes live-bootstrap to fail:
It appears that programs are run in the background as part of the build process for many different packages. These programs don't necessarily finish before the package build finishes. I was not able to find a simple way to avoid this behavior.
I have a patch I have been applying that disables the check in Fiwix, which is in a forthcoming PR. I haven't seen any bad side effects of removing this check but I haven't explored all the possible issues. If there is an issue with this change perhaps it could be configurable.