Make NFS wait in its releasepage() op if FS-Cache is busy with a page and
__GFP_WAIT was supplied in the gfp parameter rather than returning false to the
VM.
Signed-Off-By: David Howells <[email protected]>
---
fs/nfs/file.c | 2 +-
fs/nfs/fscache.h | 9 ++++++---
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 9da03ec..6ac3ac7 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -350,7 +350,7 @@ static int nfs_release_page(struct page
if (nfs_wb_page(page->mapping->host, page) < 0)
return 0;
- if (nfs_fscache_release_page(page) < 0)
+ if (nfs_fscache_release_page(page, gfp) < 0)
return 0;
/* PG_private may have been set due to either caching or writing */
diff --git a/fs/nfs/fscache.h b/fs/nfs/fscache.h
index 92c2dbf..c363421 100644
--- a/fs/nfs/fscache.h
+++ b/fs/nfs/fscache.h
@@ -238,10 +238,13 @@ static inline void nfs_fscache_install_v
* release the caching state associated with a page, if the page isn't busy
* interacting with the cache
*/
-static inline int nfs_fscache_release_page(struct page *page)
+static inline int nfs_fscache_release_page(struct page *page, gfp_t gfp)
{
- if (PageFsMisc(page))
- return -EBUSY;
+ if (PageFsMisc(page)) {
+ if (!(gfp & __GFP_WAIT))
+ return -EBUSY;
+ wait_on_page_fs_misc(page);
+ }
if (PageNfsCached(page)) {
struct nfs_inode *nfsi = NFS_I(page->mapping->host);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]