login
Login
/
Register
Search
Header Space
Forums
News
Jobs
Blogs
Features
Man Pages
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
December
»
14
Re: [PATCH 09/28] FS-Cache: Release page->private after failed readahead [try #2]
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
From:
Nick Piggin <nickpiggin@...>
To: David Howells <dhowells@...>
Cc: <viro@...>, <hch@...>, <Trond.Myklebust@...>, <sds@...>, <casey@...>, <linux-kernel@...>, <selinux@...>, <linux-security-module@...>
Subject:
Re: [PATCH 09/28] FS-Cache: Release page->private after failed readahead [try #2]
Date: Thursday, December 13, 2007 - 11:51 pm
On Thursday 06 December 2007 06:39, David Howells wrote:
quoted text
> The attached patch causes read_cache_pages() to release page-private data > on a page for which add_to_page_cache() fails or the filler function fails. > This permits pages with caching references associated with them to be > cleaned up. > > The invalidatepage() address space op is called (indirectly) to do the > honours.
This is pretty nasty. I would suggest either to have the function return the number of pages that were added to pagecache, or just open code it.
quoted text
> > Signed-off-by: David Howells <dhowells@redhat.com> > --- > > mm/readahead.c | 39 +++++++++++++++++++++++++++++++++++++-- > 1 files changed, 37 insertions(+), 2 deletions(-) > > diff --git a/mm/readahead.c b/mm/readahead.c > index c9c50ca..75aa6b6 100644 > --- a/mm/readahead.c > +++ b/mm/readahead.c > @@ -44,6 +44,41 @@ EXPORT_SYMBOL_GPL(file_ra_state_init); > > #define list_to_page(head) (list_entry((head)->prev, struct page, lru)) > > +/* > + * see if a page needs releasing upon read_cache_pages() failure > + * - the caller of read_cache_pages() may have set PG_private before > calling, + * such as the NFS fs marking pages that are cached locally on > disk, thus we + * need to give the fs a chance to clean up in the event > of an error + */ > +static void read_cache_pages_invalidate_page(struct address_space > *mapping, + struct page *page) > +{ > + if (PagePrivate(page)) { > + if (TestSetPageLocked(page)) > + BUG(); > + page->mapping = mapping; > + do_invalidatepage(page, 0); > + page->mapping = NULL; > + unlock_page(page); > + } > + page_cache_release(page); > +} > + > +/* > + * release a list of pages, invalidating them first if need be > + */ > +static void read_cache_pages_invalidate_pages(struct address_space > *mapping, + struct list_head *pages) > +{ > + struct page *victim; > + > + while (!list_empty(pages)) { > + victim = list_to_page(pages); > + list_del(&victim->lru); > + read_cache_pages_invalidate_page(mapping, victim); > + } > +} > + > /** > * read_cache_pages - populate an address space with some pages & start > reads against them * @mapping: the address_space > @@ -65,14 +100,14 @@ int read_cache_pages(struct address_space *mapping, > struct list_head *pages, list_del(&page->lru); > if (add_to_page_cache_lru(page, mapping, > page->index, GFP_KERNEL)) { > - page_cache_release(page); > + read_cache_pages_invalidate_page(mapping, page); > continue; > } > page_cache_release(page); > > ret = filler(data, page); > if (unlikely(ret)) { > - put_pages_list(pages); > + read_cache_pages_invalidate_pages(mapping, pages); > break; > } > task_io_account_read(PAGE_CACHE_SIZE); >
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 00/28] Permit filesystem local caching [try #2]
, David Howells
, (Wed Dec 5, 3:38 pm)
[PATCH 28/28] FS-Cache: Make kAFS use FS-Cache [try #2]
, David Howells
, (Wed Dec 5, 3:40 pm)
[PATCH 27/28] AFS: Implement shared-writable mmap [try #2]
, David Howells
, (Wed Dec 5, 3:40 pm)
[PATCH 26/28] AF_RXRPC: Save the operation ID for debugging ...
, David Howells
, (Wed Dec 5, 3:40 pm)
[PATCH 25/28] AFS: Improve handling of a rejected writeback ...
, David Howells
, (Wed Dec 5, 3:40 pm)
[PATCH 24/28] AFS: Add a function to excise a rejected write...
, David Howells
, (Wed Dec 5, 3:40 pm)
Re: [PATCH 24/28] AFS: Add a function to excise a rejected w...
, Nick Piggin
, (Fri Dec 14, 12:21 am)
[PATCH 23/28] AFS: Add TestSetPageError() [try #2]
, David Howells
, (Wed Dec 5, 3:40 pm)
[PATCH 22/28] fcrypt endianness misannotations [try #2]
, David Howells
, (Wed Dec 5, 3:40 pm)
[PATCH 21/28] NFS: Display local caching state [try #2]
, David Howells
, (Wed Dec 5, 3:40 pm)
[PATCH 20/28] NFS: Configuration and mount option changes to...
, David Howells
, (Wed Dec 5, 3:40 pm)
[PATCH 19/28] NFS: Use local caching [try #2]
, David Howells
, (Wed Dec 5, 3:39 pm)
[PATCH 18/28] CacheFiles: A cache that backs onto a mounted ...
, David Howells
, (Wed Dec 5, 3:39 pm)
[PATCH 17/28] CacheFiles: Export things for CacheFiles [try ...
, David Howells
, (Wed Dec 5, 3:39 pm)
[PATCH 16/28] CacheFiles: Permit the page lock state to be m...
, David Howells
, (Wed Dec 5, 3:39 pm)
[PATCH 15/28] CacheFiles: Add a hook to write a single page ...
, David Howells
, (Wed Dec 5, 3:39 pm)
[PATCH 14/28] CacheFiles: Be consistent about the use of map...
, David Howells
, (Wed Dec 5, 3:39 pm)
[PATCH 13/28] CacheFiles: Add missing copy_page export for i...
, David Howells
, (Wed Dec 5, 3:39 pm)
[PATCH 12/28] FS-Cache: Generic filesystem caching facility ...
, David Howells
, (Wed Dec 5, 3:39 pm)
[PATCH 11/28] FS-Cache: Provide an add_wait_queue_tail() fun...
, David Howells
, (Wed Dec 5, 3:39 pm)
[PATCH 10/28] FS-Cache: Recruit a couple of page flags for c...
, David Howells
, (Wed Dec 5, 3:39 pm)
Re: [PATCH 10/28] FS-Cache: Recruit a couple of page flags f...
, Nick Piggin
, (Fri Dec 14, 12:08 am)
[PATCH 09/28] FS-Cache: Release page->private after faile...
, David Howells
, (Wed Dec 5, 3:39 pm)
Re: [PATCH 09/28] FS-Cache: Release page->private after f...
, Nick Piggin
, (Thu Dec 13, 11:51 pm)
[PATCH 08/28] SECURITY: Allow kernel services to override LS...
, David Howells
, (Wed Dec 5, 3:38 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Mon Dec 10, 12:46 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Mon Dec 10, 1:07 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Mon Dec 10, 1:23 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Wed Jan 9, 12:51 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Wed Jan 9, 2:11 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Mon Jan 14, 10:01 am)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Tue Jan 15, 10:56 am)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Tue Jan 15, 12:03 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Casey Schaufler
, (Tue Jan 15, 2:10 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Tue Jan 15, 3:15 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Tue Jan 15, 5:55 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Casey Schaufler
, (Tue Jan 15, 6:23 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Tue Jan 15, 12:08 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Casey Schaufler
, (Mon Jan 14, 10:52 am)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Mon Jan 14, 11:19 am)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Mon Jan 14, 10:06 am)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Tue Jan 15, 10:58 am)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Wed Jan 23, 4:52 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, James Morris
, (Wed Jan 23, 6:03 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Wed Jan 9, 2:56 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Wed Jan 9, 3:19 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Thu Jan 10, 7:09 am)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Wed Jan 9, 1:27 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Mon Dec 10, 5:08 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Mon Dec 10, 5:27 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Casey Schaufler
, (Mon Dec 10, 6:26 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Mon Dec 10, 7:44 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Casey Schaufler
, (Mon Dec 10, 7:56 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Tue Dec 11, 2:34 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Casey Schaufler
, (Tue Dec 11, 3:26 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Tue Dec 11, 3:56 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Casey Schaufler
, (Tue Dec 11, 4:40 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Mon Dec 10, 7:36 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Casey Schaufler
, (Mon Dec 10, 7:46 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Tue Dec 11, 3:52 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Tue Dec 11, 3:37 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Tue Dec 11, 4:42 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Casey Schaufler
, (Tue Dec 11, 5:18 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Tue Dec 11, 5:34 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Tue Dec 11, 6:43 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Casey Schaufler
, (Tue Dec 11, 7:04 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Wed Dec 12, 2:25 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Casey Schaufler
, (Wed Dec 12, 3:20 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Wed Dec 12, 3:35 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Wed Dec 12, 6:55 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Thu Dec 13, 10:51 am)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Thu Dec 13, 12:03 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Wed Dec 12, 3:29 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Wed Dec 12, 11:25 am)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Casey Schaufler
, (Wed Dec 12, 12:51 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Wed Dec 12, 2:34 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Casey Schaufler
, (Wed Dec 12, 3:44 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Wed Dec 12, 6:32 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Wed Dec 12, 3:49 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Casey Schaufler
, (Wed Dec 12, 4:09 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Wed Dec 12, 6:29 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Wed Dec 12, 2:12 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Wed Dec 12, 2:29 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Casey Schaufler
, (Wed Dec 12, 3:37 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Wed Dec 12, 6:52 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Wed Dec 12, 3:33 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Wed Dec 12, 6:49 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Thu Dec 13, 10:49 am)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Thu Dec 13, 11:36 am)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Thu Dec 13, 12:23 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Thu Dec 13, 1:01 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Stephen Smalley
, (Thu Dec 13, 1:27 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Thu Dec 13, 2:04 pm)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Karl MacMillan
, (Wed Dec 12, 10:41 am)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, David Howells
, (Wed Dec 12, 10:53 am)
Re: [PATCH 08/28] SECURITY: Allow kernel services to overrid...
, Karl MacMillan
, (Wed Dec 12, 10:59 am)
[PATCH 07/28] SECURITY: De-embed task security record from t...
, David Howells
, (Wed Dec 5, 3:38 pm)
[PATCH 06/28] SECURITY: Separate task security context from ...
, David Howells
, (Wed Dec 5, 3:38 pm)
[PATCH 05/28] Security: Change current->fs[ug]id to curre...
, David Howells
, (Wed Dec 5, 3:38 pm)
[PATCH 04/28] KEYS: Add keyctl function to get a security la...
, David Howells
, (Wed Dec 5, 3:38 pm)
[PATCH 03/28] KEYS: Allow the callout data to be passed as a...
, David Howells
, (Wed Dec 5, 3:38 pm)
[PATCH 02/28] KEYS: Check starting keyring as part of search...
, David Howells
, (Wed Dec 5, 3:38 pm)
[PATCH 01/28] KEYS: Increase the payload size when instantia...
, David Howells
, (Wed Dec 5, 3:38 pm)
Navigation
Create content
Mailing list archives
Recent posts
Mail archive search
Enter your search terms.
all mailing lists
alsa-devel
dragonflybsd-bugs
dragonflybsd-commit
dragonflybsd-docs
dragonflybsd-kernel
dragonflybsd-submit
dragonflybsd-user
freebsd-announce
freebsd-bugs
freebsd-chat
freebsd-cluster
freebsd-current
freebsd-drivers
freebsd-embeded
freebsd-fs
freebsd-hackers
freebsd-hardware
freebsd-mobile
freebsd-net
freebsd-performance
freebsd-pf
freebsd-security
freebsd-security-notifications
freebsd-threads
git
git-commits-head
linux-activists
linux-arm
linux-ath5k-devel
linux-c-programming
linux-driver-devel
linux-ext4
linux-fsdevel
linux-input
linux-kernel
linux-kernel-janitors
linux-kernel-mentors
linux-kernel-newbies
linux-net
linux-netdev
linux-newbie
linux-nfs
linux-raid
linux-scsi
linux-security-module
linux-sparse
linux-usb
linux-usb-devel
madwifi-devel
netbsd-announce
netbsd-tech-kern
openbsd-announce
openbsd-bugs
openbsd-ipv6
openbsd-misc
openbsd-security-announce
openbsd-smp
openbsd-source-changes
openbsd-tech
openfabrics-general
openmoko-community
openmoko-devel
openmoko-kernel
ucarp
Optionally limit your search to a specific mailing list.
advanced
Popular discussions
linux-kernel
:
Linus Torvalds
Re: [GIT]: Networking
Arjan van de Ven
[patch 1/3] LatencyTOP infrastructure patch
Greg Kroah-Hartman
[PATCH 023/196] MCP_UCB1200: Convert from class_device to device
James Morris
Re: LSM conversion to static interface
git
:
Wink Saville
Resolving conflicts
Junio C Hamano
Re: [PATCH] Teach git-gui to split hunks
Linus Torvalds
Re: kde.git is now online
Steffen Prohaska
[PATCH] cygwin: added fopen "b" and open O_BINARY to support cygwin's textmode
openbsd-misc
:
Almir Karic
Re: find -exec {} help
Richard Stallman
Real men don't attack straw men
Khalid Schofield
Configuring sendmail openbsd 4.2
Timo Myyrä
Encrypting home partition
linux-netdev
:
David Miller
[GIT]: Networking
Andi Kleen
[PATCH] Add a statistics counter for tx hash miss
David Miller
Re: [BUG] kernel BUG at net/core/dev.c:1328!
David Miller
Re: netif_schedule and mpc5200_fec
Latest forum posts
problem with 2.6 kernel driver for a USB MAG Stripe Reader as HID device.
3 hours ago
Linux kernel
get_user_pages failure
5 hours ago
Linux kernel
Reading linux kernel
6 hours ago
Linux kernel
High level of Seagate 2.5" SATA drives failing
12 hours ago
Hardware
Resetting the bios password for Toshiba Laptop
16 hours ago
Hardware
Linux 2.6.22 slowly RUNS OUT OF LOWMEM
18 hours ago
Linux kernel
Questions about modules
1 day ago
Linux kernel
KDB
1 day ago
Linux kernel
Writing a framebuffer driver for an embedded spi interface (!!)
1 day ago
Linux kernel
System with alot of memory doing nothing, locks up after OOM-Killer
1 day ago
Linux kernel
Show all forums...
Recent Tags
2.6.26
2.0
Evgeniy Polyakov
H. Peter Anvin
Matthew Dillon
HAMMER
Alan Cox
Linux
Theodore T'so
bugs
Linus Torvalds
Christoph Hellwig
security
quote
2.6.25
DragonFlyBSD
Greg KH
ZFS
filesystem
release
more tags
Colocation donated by:
Who's online
There are currently
4 users
and
981 guests
online.
Online users
Mr_Z
Jeremy
strcmp
Timothy Brownawell
Syndicate
speck-geostationary