From b1b69e678c9ac453da3ae7a8d28c5728fed32765 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Wed, 12 Oct 2011 10:57:42 -0400 Subject: [PATCH] --- yaml --- r: 267208 b: refs/heads/master c: 2da956523526e440ef4f4dd174e26f5ac06fe011 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/nfs/write.c | 36 +++++++++++------------------------- 2 files changed, 12 insertions(+), 26 deletions(-) diff --git a/[refs] b/[refs] index e8609fcb50b4..06df8caa974a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b9dd3abbbc708da5e3c53424a5b2c66ab580f97e +refs/heads/master: 2da956523526e440ef4f4dd174e26f5ac06fe011 diff --git a/trunk/fs/nfs/write.c b/trunk/fs/nfs/write.c index 46aa4389ce13..72813ede029e 100644 --- a/trunk/fs/nfs/write.c +++ b/trunk/fs/nfs/write.c @@ -1691,34 +1691,20 @@ int nfs_wb_page(struct inode *inode, struct page *page) int nfs_migrate_page(struct address_space *mapping, struct page *newpage, struct page *page) { - struct nfs_page *req; - int ret; + /* + * If PagePrivate is set, then the page is currently associated with + * an in-progress read or write request. Don't try to migrate it. + * + * FIXME: we could do this in principle, but we'll need a way to ensure + * that we can safely release the inode reference while holding + * the page lock. + */ + if (PagePrivate(page)) + return -EBUSY; nfs_fscache_release_page(page, GFP_KERNEL); - req = nfs_find_and_lock_request(page, false); - ret = PTR_ERR(req); - if (IS_ERR(req)) - goto out; - - ret = migrate_page(mapping, newpage, page); - if (!req) - goto out; - if (ret) - goto out_unlock; - page_cache_get(newpage); - spin_lock(&mapping->host->i_lock); - req->wb_page = newpage; - SetPagePrivate(newpage); - set_page_private(newpage, (unsigned long)req); - ClearPagePrivate(page); - set_page_private(page, 0); - spin_unlock(&mapping->host->i_lock); - page_cache_release(page); -out_unlock: - nfs_clear_page_tag_locked(req); -out: - return ret; + return migrate_page(mapping, newpage, page); } #endif