File opener count was not decreased in vm_file_put

This commit is contained in:
Bahadir Balban
2009-05-14 13:07:10 +03:00
parent 3b8386fe7d
commit f37cadf5c8
2 changed files with 5 additions and 1 deletions

View File

@@ -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 */

View 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;