linux/mm
Hugh Dickins 59a16ead57 tmpfs: fix spurious ENOSPC when racing with unswap
Testing the shmem_swaplist replacements for igrab() revealed another bug:
writes to /dev/loop0 on a tmpfs file which fills its filesystem were
sometimes failing with "Buffer I/O error"s.

These came from ENOSPC failures of shmem_getpage(), when racing with
swapoff: the same could happen when racing with another shmem_getpage(),
pulling the page in from swap in between our find_lock_page() and our
taking the info->lock (though not in the single-threaded loop case).

This is unacceptable, and surprising that I've not noticed it before:
it dates back many years, but (presumably) was made a lot easier to
reproduce in 2.6.36, which sited a page preallocation in the race window.

Fix it by rechecking the page cache before settling on an ENOSPC error.

Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-05-11 18:50:45 -07:00
..
Kconfig
Kconfig.debug
Makefile
backing-dev.c Fix common misspellings 2011-03-31 11:26:23 -03:00
bootmem.c
bounce.c
compaction.c
debug-pagealloc.c
dmapool.c
fadvise.c
failslab.c
filemap.c
filemap_xip.c
fremap.c
highmem.c
huge_memory.c mm: thp: fix /dev/zero MAP_PRIVATE and vm_flags cleanups 2011-04-28 11:28:20 -07:00
hugetlb.c Fix common misspellings 2011-03-31 11:26:23 -03:00
hwpoison-inject.c Fix common misspellings 2011-03-31 11:26:23 -03:00
init-mm.c
internal.h Fix common misspellings 2011-03-31 11:26:23 -03:00
kmemcheck.c
kmemleak-test.c
kmemleak.c Fix common misspellings 2011-03-31 11:26:23 -03:00
ksm.c Fix common misspellings 2011-03-31 11:26:23 -03:00
maccess.c
madvise.c
memblock.c
memcontrol.c Fix common misspellings 2011-03-31 11:26:23 -03:00
memory-failure.c Fix common misspellings 2011-03-31 11:26:23 -03:00
memory.c Don't lock guardpage if the stack is growing up 2011-05-09 16:22:07 -07:00
memory_hotplug.c mm: optimize pfn calculation in online_page() 2011-04-14 16:06:54 -07:00
mempolicy.c
mempool.c
migrate.c Fix common misspellings 2011-03-31 11:26:23 -03:00
mincore.c
mlock.c VM: skip the stack guard page lookup in get_user_pages only for mlock 2011-05-04 21:30:28 -07:00
mm_init.c
mmap.c vm: fix vm_pgoff wrap in upward expansion 2011-05-09 17:52:17 -07:00
mmu_context.c
mmu_notifier.c
mmzone.c
mprotect.c
mremap.c mm: avoid wrapping vm_pgoff in mremap() 2011-04-07 07:35:51 -07:00
msync.c
nobootmem.c Fix common misspellings 2011-03-31 11:26:23 -03:00
nommu.c NOMMU: implement access_remote_vm 2011-03-29 14:05:12 +01:00
oom_kill.c oom: use pte pages in OOM score 2011-04-28 11:28:21 -07:00
page-writeback.c
page_alloc.c mm: add alloc_pages_exact_nid() 2011-05-11 18:50:45 -07:00
page_cgroup.c memcg: allocate memory cgroup structures in local nodes 2011-05-11 18:50:45 -07:00
page_io.c
page_isolation.c
pagewalk.c
percpu-km.c
percpu-vm.c
percpu.c Fix common misspellings 2011-03-31 11:26:23 -03:00
pgtable-generic.c
prio_tree.c
quicklist.c
readahead.c
rmap.c
shmem.c tmpfs: fix spurious ENOSPC when racing with unswap 2011-05-11 18:50:45 -07:00
slab.c Fix common misspellings 2011-03-31 11:26:23 -03:00
slob.c
slub.c slub: Fix the lockless code on 32-bit platforms with no 64-bit cmpxchg 2011-05-04 14:20:20 -07:00
sparse-vmemmap.c
sparse.c Fix common misspellings 2011-03-31 11:26:23 -03:00
swap.c mm: check PageUnevictable in lru_deactivate_fn() 2011-05-11 18:50:44 -07:00
swap_state.c
swapfile.c
thrash.c
truncate.c
util.c Fix common misspellings 2011-03-31 11:26:23 -03:00
vmalloc.c
vmscan.c vmscan: all_unreclaimable() use zone->all_unreclaimable as a name 2011-04-14 16:06:56 -07:00
vmstat.c mm: add VM counters for transparent hugepages 2011-04-14 16:06:55 -07:00