浏览代码

NFS: Fix a list corruption problem

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>
Trond Myklebust 18 年之前
父节点
当前提交
eb4cac10d9
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      fs/nfs/write.c

+ 3 - 1
fs/nfs/write.c

@@ -280,8 +280,10 @@ static int nfs_page_mark_flush(struct page *page)
 		spin_lock(req_lock);
 		spin_lock(req_lock);
 	}
 	}
 	spin_unlock(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);
 		nfs_mark_request_dirty(req);
+	}
 	ret = test_bit(PG_NEED_FLUSH, &req->wb_flags);
 	ret = test_bit(PG_NEED_FLUSH, &req->wb_flags);
 	nfs_unlock_request(req);
 	nfs_unlock_request(req);
 	return ret;
 	return ret;