Signed-off-by: Andrew Morton --- 25-akpm/mm/memory.c | 4 ++++ 1 files changed, 4 insertions(+) diff -puN mm/memory.c~dont-hold-i_sem-on-swapfiles-comment mm/memory.c --- 25/mm/memory.c~dont-hold-i_sem-on-swapfiles-comment 2004-06-26 15:02:14.110776632 -0700 +++ 25-akpm/mm/memory.c 2004-06-26 15:02:56.844280152 -0700 @@ -1236,6 +1236,10 @@ int vmtruncate(struct inode * inode, lof if (inode->i_size < offset) goto do_expand; + /* + * truncation of in-use swapfiles is disallowed - it would cause + * subsequent swapout to scribble on the now-freed blocks. + */ if (IS_SWAPFILE(inode)) goto out_busy; i_size_write(inode, offset); _