mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 02:43:15 +01:00
File opener count was not decreased in vm_file_put
This commit is contained in:
@@ -510,7 +510,7 @@ int fsync_common(struct tcb *task, int fd)
|
||||
void vm_file_put(struct vm_file *file)
|
||||
{
|
||||
/* Reduce file's opener count */
|
||||
if (!(file->openers))
|
||||
if (!(file->openers--))
|
||||
/* No openers left, check any mappers */
|
||||
if (!file->vm_obj.nlinks)
|
||||
/* No links or openers, delete the file */
|
||||
|
||||
@@ -49,6 +49,10 @@ int vm_object_test_shadow_count(struct vm_object *vmo)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* TODO:
|
||||
* Add checking that total open file descriptors are
|
||||
* equal to total opener count of all files
|
||||
*/
|
||||
int mm0_test_global_vm_integrity(void)
|
||||
{
|
||||
struct tcb *task;
|
||||
|
||||
Reference in New Issue
Block a user