X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Fnfs%2Fwrite.c;h=883dd4a1c157599284f3bae5127fa69418ec06e1;hb=79acbb3ff2d8095b692e1502b9eb2ccec348de26;hp=453d44666ea58250c2f3e55243c1781e75c9cb1a;hpb=54ceac4515986030c2502960be620198dd8fe25b;p=linux-2.6 diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 453d44666e..883dd4a1c1 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -51,13 +51,14 @@ #include #include #include -#include #include #include #include #include #include +#include + #include #include @@ -396,6 +397,7 @@ int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc) out: clear_bit(BDI_write_congested, &bdi->state); wake_up_all(&nfs_write_congestion); + congestion_end(WRITE); return err; } @@ -588,10 +590,10 @@ static void nfs_cancel_commit_list(struct list_head *head) while(!list_empty(head)) { req = nfs_list_entry(head->next); + dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); nfs_list_remove_request(req); nfs_inode_remove_request(req); - dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); - nfs_clear_page_writeback(req); + nfs_unlock_request(req); } } @@ -1252,7 +1254,13 @@ int nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data) dprintk("NFS: %4d nfs_writeback_done (status %d)\n", task->tk_pid, task->tk_status); - /* Call the NFS version-specific code */ + /* + * ->write_done will attempt to use post-op attributes to detect + * conflicting writes by other clients. A strict interpretation + * of close-to-open would allow us to continue caching even if + * another writer had changed the file, but some applications + * depend on tighter cache coherency when writing. + */ status = NFS_PROTO(data->inode)->write_done(task, data); if (status != 0) return status; @@ -1558,7 +1566,6 @@ void nfs_destroy_writepagecache(void) { mempool_destroy(nfs_commit_mempool); mempool_destroy(nfs_wdata_mempool); - if (kmem_cache_destroy(nfs_wdata_cachep)) - printk(KERN_INFO "nfs_write_data: not all structures were freed\n"); + kmem_cache_destroy(nfs_wdata_cachep); }