]> git.neil.brown.name Git - history.git/commit
[PATCH] tmpfs 3/7 swapoff/truncate race fix
authorAndrew Morton <akpm@osdl.org>
Wed, 22 Oct 2003 01:20:07 +0000 (18:20 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Wed, 22 Oct 2003 01:20:07 +0000 (18:20 -0700)
commiteaec8c0c5ff784c71230d080e055ebb63b344dc1
tree518e33eef7b74f69f13865bc53b11d0dbe69a299
parentd19c7b9daa73f6117d2144c8ac83af468be23345
[PATCH] tmpfs 3/7 swapoff/truncate race fix

From: Hugh Dickins <hugh@veritas.com>

On 23 July, Sergey S. Kostyliov <rathamahata@php4.ru> reported a tmpfs
BUG_ON(inode->i_blocks) during swapoff: my last version of the fix to
swapoff/truncate race was inadequate, since I_FREEING might get set or
i_size be reduced (from another cpu) the instant after it's tested here.

So revert to the previous version of the fix, shmem_truncate calling
truncate_inode_pages again, if pages still left in cache; but avoid the
recall in usual cases of partial truncation, by having a "pagein" flag
to indicate when recall might be necessary.  (Since those flags already
use VM_ACCOUNT and VM_LOCKED, must redefine another VM_flag for this.)
Sergey and 2.4-aa have run fine with this for a couple of months.
mm/shmem.c