-
Bug
-
Resolution: Fixed
-
Minor
-
3.1.4, 3.2.1
-
MOODLE_31_STABLE, MOODLE_32_STABLE
-
MOODLE_31_STABLE, MOODLE_32_STABLE
-
MDL-57801-master -
Admittedly this is the edgiest of edge cases, and for all I know it may even be restricted to certain NFS implementations/configurations, but we got bitten by it fairly badly.
For some reason the full NFS filesystem creates a zero byte temp file but with the hash of the original file. However, the filesize check in add_file_to_pool() somehow passes anyway. So I've added another check to verify the content hash of the temp file, and fortunately this fails for the zero byte file.
I also discovered while testing this that if someone uploads a large file that fills the remaining space, this temp file is never deleted and the filesystem stays full, so I've included a fix for that too in a separate commit (this doesn't seem to be restricted to NFS filesystems).