Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 3.1.4, 3.2.1
-
Component/s: Libraries
-
Testing Instructions:
-
Affected Branches:MOODLE_31_STABLE, MOODLE_32_STABLE
-
Fixed Branches:MOODLE_31_STABLE, MOODLE_32_STABLE
-
Pull from Repository:
-
Pull Master Branch:
MDL-57801-master -
Pull Master Diff URL:
Description
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).