[PATCH 2/2] NFS: missing set_page_writeback()/end_page_writeback() in nfs_cancel_requests

From: Trond Myklebust
Date: Mon Jun 26 2006 - 19:31:28 EST


From: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>

Signed-off-by: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>
---

fs/nfs/write.c | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index d054f12..fe3eb36 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -579,7 +579,23 @@ static int nfs_wait_on_requests(struct i
return ret;
}

-static void nfs_cancel_requests(struct list_head *head)
+static void nfs_cancel_dirty_list(struct list_head *head)
+{
+ struct nfs_page *req;
+ while(!list_empty(head)) {
+ req = nfs_list_entry(head->next);
+ nfs_list_remove_request(req);
+ /* Hack, cough, splutter!
+ * Wretched borken mm requires us to do this...
+ */
+ set_page_writeback(req->wb_page);
+ end_page_writeback(req->wb_page);
+ nfs_inode_remove_request(req);
+ nfs_clear_page_writeback(req);
+ }
+}
+
+static void nfs_cancel_commit_list(struct list_head *head)
{
struct nfs_page *req;
while(!list_empty(head)) {
@@ -1503,7 +1519,7 @@ int nfs_sync_inode_wait(struct inode *in
if (pages != 0) {
spin_unlock(&nfsi->req_lock);
if (how & FLUSH_INVALIDATE)
- nfs_cancel_requests(&head);
+ nfs_cancel_dirty_list(&head);
else
ret = nfs_flush_list(inode, &head, pages, how);
spin_lock(&nfsi->req_lock);
@@ -1516,7 +1532,7 @@ int nfs_sync_inode_wait(struct inode *in
break;
if (how & FLUSH_INVALIDATE) {
spin_unlock(&nfsi->req_lock);
- nfs_cancel_requests(&head);
+ nfs_cancel_commit_list(&head);
spin_lock(&nfsi->req_lock);
continue;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/