Messages in this thread Patch in this message | | | Date | Tue, 25 Mar 2003 22:19:47 +0000 (GMT) | From | Hugh Dickins <> | Subject | [PATCH] swap 09/13 tmpfs truncation |
| |
Recent testing has shown that swapoff can sneak a page back into the tmpfs page cache after truncate_inode_pages has cleaned it, before shmem_truncate resets next_index to stop that: BUG_ON(inode->i_blocks) in shmem_delete_inode. So call truncate_inode_pages again to be safe.
--- swap08/mm/shmem.c Sun Mar 23 10:30:15 2003 +++ swap09/mm/shmem.c Tue Mar 25 20:44:24 2003 @@ -486,6 +486,16 @@ } done2: BUG_ON(info->swapped > info->next_index); + if (inode->i_mapping->nrpages) { + /* + * Call truncate_inode_pages again: racing shmem_unuse_inode + * may have swizzled a page in from swap since vmtruncate or + * generic_delete_inode did it, before we lowered next_index. + */ + spin_unlock(&info->lock); + truncate_inode_pages(inode->i_mapping, inode->i_size); + spin_lock(&info->lock); + } shmem_recalc_inode(inode); spin_unlock(&info->lock); } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |