NFS: Fix a list corruption problem
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Sun, 15 Apr 2007 20:21:49 +0000 (16:21 -0400)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 15 Apr 2007 23:48:11 +0000 (16:48 -0700)
We must remove the request from whatever list it is currently on before we
can add it to the dirty list.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/nfs/write.c

index e5d7cac569aa4ba6ba699d57e673b08427493b83..ad2e91b4904fb5d2be8d594a828e12961ba65ec5 100644 (file)
@@ -280,8 +280,10 @@ static int nfs_page_mark_flush(struct page *page)
                spin_lock(req_lock);
        }
        spin_unlock(req_lock);
-       if (nfs_set_page_writeback(page) == 0)
+       if (nfs_set_page_writeback(page) == 0) {
+               nfs_list_remove_request(req);
                nfs_mark_request_dirty(req);
+       }
        ret = test_bit(PG_NEED_FLUSH, &req->wb_flags);
        nfs_unlock_request(req);
        return ret;