linux/mm
Miklos Szeredi 84209e02de mm: dont clear PG_uptodate on truncate/invalidate
Brian Wang reported that a FUSE filesystem exported through NFS could
return I/O errors on read.  This was traced to splice_direct_to_actor()
returning a short or zero count when racing with page invalidation.

However this is not FUSE or NFSD specific, other filesystems (notably
NFS) also call invalidate_inode_pages2() to purge stale data from the
cache.

If this happens while such pages are sitting in a pipe buffer, then
splice(2) from the pipe can return zero, and read(2) from the pipe can
return ENODATA.

The zero return is especially bad, since it implies end-of-file or
disconnected pipe/socket, and is documented as such for splice.  But
returning an error for read() is also nasty, when in fact there was no
error (data becoming stale is not an error).

The same problems can be triggered by "hole punching" with
madvise(MADV_REMOVE).

Fix this by not clearing the PG_uptodate flag on truncation and
invalidation.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Acked-by: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-08-02 09:12:34 -07:00
..
allocpercpu.c mm/allocpercpu.c: make 4 functions static 2008-07-26 12:00:12 -07:00
backing-dev.c
bootmem.c
bounce.c
dmapool.c
fadvise.c
filemap_xip.c mmu-notifiers: core 2008-07-28 16:30:21 -07:00
filemap.c Fix off-by-one error in iov_iter_advance() 2008-07-30 14:50:18 -07:00
fremap.c mmu-notifiers: core 2008-07-28 16:30:21 -07:00
highmem.c
hugetlb.c mm/hugetlb: don't crash when HPAGE_SHIFT is 0 2008-08-01 12:46:41 -07:00
internal.h
Kconfig mmu-notifiers: core 2008-07-28 16:30:21 -07:00
maccess.c
madvise.c madvise: update function comment of madvise_dontneed 2008-07-30 09:41:45 -07:00
Makefile mmu-notifiers: core 2008-07-28 16:30:21 -07:00
memcontrol.c memcg: remove redundant check in move_task() 2008-07-30 09:41:44 -07:00
memory_hotplug.c
memory.c Remove EXPORTS of follow_page & zap_page_range 2008-08-01 13:19:16 -07:00
mempolicy.c
mempool.c
migrate.c mm: spinlock tree_lock 2008-07-26 12:00:06 -07:00
mincore.c
mlock.c
mm_init.c
mmap.c mmu-notifiers: core 2008-07-28 16:30:21 -07:00
mmu_notifier.c mmu-notifiers: core 2008-07-28 16:30:21 -07:00
mmzone.c
mprotect.c mmu-notifiers: core 2008-07-28 16:30:21 -07:00
mremap.c mmu-notifiers: core 2008-07-28 16:30:21 -07:00
msync.c
nommu.c tracehook: tracehook_expect_breakpoints 2008-07-26 12:00:09 -07:00
oom_kill.c
page_alloc.c mm: remove find_max_pfn_with_active_regions 2008-07-30 09:41:44 -07:00
page_io.c
page_isolation.c
page-writeback.c mm: spinlock tree_lock 2008-07-26 12:00:06 -07:00
pagewalk.c
pdflush.c
prio_tree.c
quicklist.c
readahead.c mm: readahead scan lockless 2008-07-26 12:00:06 -07:00
rmap.c [S390] Optimize storage key operations for anon pages 2008-08-01 16:39:30 +02:00
shmem_acl.c [PATCH] sanitize ->permission() prototype 2008-07-26 20:53:14 -04:00
shmem.c tmpfs: fix kernel BUG in shmem_delete_inode 2008-07-28 16:30:20 -07:00
slab.c SL*B: drop kmem cache argument from constructor 2008-07-26 12:00:07 -07:00
slob.c SL*B: drop kmem cache argument from constructor 2008-07-26 12:00:07 -07:00
slub.c SL*B: drop kmem cache argument from constructor 2008-07-26 12:00:07 -07:00
sparse-vmemmap.c
sparse.c make mm/sparse.c: make a function static 2008-07-26 12:00:12 -07:00
swap_state.c mm: print swapcache page count in show_swap_cache_info() 2008-07-26 12:00:10 -07:00
swap.c swap: update function comment of release_pages 2008-07-30 09:41:46 -07:00
swapfile.c swapfile/vmscan: update comments related to vmscan functions 2008-07-30 09:41:46 -07:00
thrash.c
tiny-shmem.c
truncate.c mm: dont clear PG_uptodate on truncate/invalidate 2008-08-02 09:12:34 -07:00
util.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-07-26 20:17:56 -07:00
vmalloc.c Use WARN() in mm/vmalloc.c 2008-07-26 12:00:07 -07:00
vmscan.c do_try_to_free_page: update comments related to vmscan functions 2008-07-30 09:41:46 -07:00
vmstat.c