VFS: don't garbage collect if file is already closed

This commit is contained in:
Thomas Veerman 2013-02-15 16:09:24 +01:00
parent cfcce207c1
commit 2b90964e33

View file

@ -86,6 +86,15 @@ void *do_filp_gc(void *UNUSED(arg))
for (f = &filp[0]; f < &filp[NR_FILPS]; f++) {
if (!(f->filp_state & FS_INVALIDATED)) continue;
if (f->filp_mode == FILP_CLOSED || f->filp_vno == NULL) {
/* File was already closed before gc could kick in */
assert(f->filp_count <= 0);
f->filp_state &= ~FS_INVALIDATED;
f->filp_count = 0;
continue;
}
assert(f->filp_vno != NULL);
vp = f->filp_vno;