提交 cb876f45 编写于 作者: L Linus Torvalds

Fix up CIFS for "test_clear_page_dirty()" removal

This also adds he required page "writeback" flag handling, that cifs
hasn't been doing and that the page dirty flag changes made obvious.
Acked-by: NSteve French <smfltc@us.ibm.com>
Acked-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 8d1c4819
...@@ -1245,14 +1245,21 @@ static int cifs_writepages(struct address_space *mapping, ...@@ -1245,14 +1245,21 @@ static int cifs_writepages(struct address_space *mapping,
wait_on_page_writeback(page); wait_on_page_writeback(page);
if (PageWriteback(page) || if (PageWriteback(page) ||
!test_clear_page_dirty(page)) { !clear_page_dirty_for_io(page)) {
unlock_page(page); unlock_page(page);
break; break;
} }
/*
* This actually clears the dirty bit in the radix tree.
* See cifs_writepage() for more commentary.
*/
set_page_writeback(page);
if (page_offset(page) >= mapping->host->i_size) { if (page_offset(page) >= mapping->host->i_size) {
done = 1; done = 1;
unlock_page(page); unlock_page(page);
end_page_writeback(page);
break; break;
} }
...@@ -1316,6 +1323,7 @@ static int cifs_writepages(struct address_space *mapping, ...@@ -1316,6 +1323,7 @@ static int cifs_writepages(struct address_space *mapping,
SetPageError(page); SetPageError(page);
kunmap(page); kunmap(page);
unlock_page(page); unlock_page(page);
end_page_writeback(page);
page_cache_release(page); page_cache_release(page);
} }
if ((wbc->nr_to_write -= n_iov) <= 0) if ((wbc->nr_to_write -= n_iov) <= 0)
...@@ -1353,9 +1361,21 @@ static int cifs_writepage(struct page* page, struct writeback_control *wbc) ...@@ -1353,9 +1361,21 @@ static int cifs_writepage(struct page* page, struct writeback_control *wbc)
cFYI(1, ("ppw - page not up to date")); cFYI(1, ("ppw - page not up to date"));
} }
/*
* Set the "writeback" flag, and clear "dirty" in the radix tree.
*
* A writepage() implementation always needs to do either this,
* or re-dirty the page with "redirty_page_for_writepage()" in
* the case of a failure.
*
* Just unlocking the page will cause the radix tree tag-bits
* to fail to update with the state of the page correctly.
*/
set_page_writeback(page);
rc = cifs_partialpagewrite(page, 0, PAGE_CACHE_SIZE); rc = cifs_partialpagewrite(page, 0, PAGE_CACHE_SIZE);
SetPageUptodate(page); /* BB add check for error and Clearuptodate? */ SetPageUptodate(page); /* BB add check for error and Clearuptodate? */
unlock_page(page); unlock_page(page);
end_page_writeback(page);
page_cache_release(page); page_cache_release(page);
FreeXid(xid); FreeXid(xid);
return rc; return rc;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册