diff mbox

oops in nfs_flush_incompatible (and possible fix?)

Message ID 20101207213540.441330db@corrin.poochiereds.net (mailing list archive)
State Superseded, archived
Delegated to: Trond Myklebust
Headers show

Commit Message

Jeff Layton Dec. 8, 2010, 2:35 a.m. UTC
None
diff mbox

Patch

diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index e4b62c6..aedcaa7 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -152,7 +152,6 @@  static void nfs_readpage_release(struct nfs_page *req)
 			(long long)NFS_FILEID(req->wb_context->path.dentry->d_inode),
 			req->wb_bytes,
 			(long long)req_offset(req));
-	nfs_clear_request(req);
 	nfs_release_request(req);
 }
 
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 4c14c17..04857c0 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -407,14 +407,16 @@  out:
  */
 static void nfs_inode_remove_request(struct nfs_page *req)
 {
+	struct page *page;
 	struct inode *inode = req->wb_context->path.dentry->d_inode;
 	struct nfs_inode *nfsi = NFS_I(inode);
 
 	BUG_ON (!NFS_WBACK_BUSY(req));
 
 	spin_lock(&inode->i_lock);
-	set_page_private(req->wb_page, 0);
-	ClearPagePrivate(req->wb_page);
+	page = xchg(&req->wb_page, NULL);
+	set_page_private(page, 0);
+	ClearPagePrivate(page);
 	radix_tree_delete(&nfsi->nfs_page_tree, req->wb_index);
 	nfsi->npages--;
 	if (!nfsi->npages) {
@@ -422,7 +424,8 @@  static void nfs_inode_remove_request(struct nfs_page *req)
 		iput(inode);
 	} else
 		spin_unlock(&inode->i_lock);
-	nfs_clear_request(req);
+	if (page != NULL)
+		page_cache_release(page);
 	nfs_release_request(req);
 }