Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45017
b: refs/heads/master
c: cb876f4
h: refs/heads/master
i:
  45015: 7e279e1
v: v3
  • Loading branch information
Linus Torvalds committed Dec 24, 2006
1 parent 7aa3b12 commit 846c46b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8d1c481960ba833362aa78245fdff12e3804f8b5
refs/heads/master: cb876f451455b6187a7d69de2c112c45ec4b7f99
26 changes: 23 additions & 3 deletions trunk/fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1245,14 +1245,21 @@ static int cifs_writepages(struct address_space *mapping,
wait_on_page_writeback(page);

if (PageWriteback(page) ||
!test_clear_page_dirty(page)) {
!clear_page_dirty_for_io(page)) {
unlock_page(page);
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) {
done = 1;
unlock_page(page);
end_page_writeback(page);
break;
}

Expand Down Expand Up @@ -1316,6 +1323,7 @@ static int cifs_writepages(struct address_space *mapping,
SetPageError(page);
kunmap(page);
unlock_page(page);
end_page_writeback(page);
page_cache_release(page);
}
if ((wbc->nr_to_write -= n_iov) <= 0)
Expand Down Expand Up @@ -1352,11 +1360,23 @@ static int cifs_writepage(struct page* page, struct writeback_control *wbc)
if (!PageUptodate(page)) {
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);
SetPageUptodate(page); /* BB add check for error and Clearuptodate? */
unlock_page(page);
page_cache_release(page);
end_page_writeback(page);
page_cache_release(page);
FreeXid(xid);
return rc;
}
Expand Down

0 comments on commit 846c46b

Please sign in to comment.