linux_old1/fs/ramfs
Johannes Weiner 15e7b87676 nommu: ramfs: don't leak pages when adding to page cache fails
When a ramfs nommu mapping is expanded, contiguous pages are allocated
and added to the pagecache.  The caller's reference is then passed on
by moving whole pagevecs to the file lru list.

If the page cache adding fails, make sure that the error path also
moves the pagevec contents which might still contain up to PAGEVEC_SIZE
successfully added pages, of which we would leak references otherwise.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Enrik Berkhan <Enrik.Berkhan@ge.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-03-14 11:57:22 -07:00
..
Makefile Remove valueless definition of hard-selected RAMFS option 2007-10-17 08:42:56 -07:00
file-mmu.c ramfs: enable splice write 2008-07-04 09:52:14 +02:00
file-nommu.c nommu: ramfs: don't leak pages when adding to page cache fails 2009-03-14 11:57:22 -07:00
inode.c zero i_uid/i_gid on inode allocation 2009-01-05 11:54:28 -05:00
internal.h fs/ramfs/ extern cleanup 2008-04-29 08:06:00 -07:00