From: wangdi Date: Wed, 1 Nov 2006 03:41:19 +0000 (+0000) Subject: Branch: b_new_cmd X-Git-Tag: v1_8_0_110~486^2~276 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=08c186c1be314e1809d2a8bc5896eb628152d29c;p=fs%2Flustre-release.git Branch: b_new_cmd Only when writing page succeed, then we check whether the inode should be put the close list, since when page writing failed, it will be redirtied and writing again later. --- diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index 7fbcaba..9001074 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -892,7 +892,20 @@ int ll_ap_completion(void *data, int cmd, struct obdo *oa, int rc) unlock_page(page); if (cmd & OBD_BRW_WRITE) { - if (llap_write_complete(page->mapping->host, llap)) + /* Only rc == 0, write succeed, then we should handle + * write queue done list. because we redirty this page, + * and which will be wrote again. + * XXX There are also + * problems here. For example, + * 1) The inode closed(also finish writing), has been add to + * the list of the done_writing queue. + * 2) Then another thread open the file again, write some pages + * close the inode again, then the inode will be put to this + * list again, if the first item are still in the list, then + * it may cause some problems. + * So that close list should be per-file, not per-inode? Wangdi + */ + if (rc == 0 && llap_write_complete(page->mapping->host, llap)) ll_queue_done_writing(page->mapping->host, 0); }