Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44857
b: refs/heads/master
c: 46d2277
h: refs/heads/master
i:
  44855: c3101fd
v: v3
  • Loading branch information
Linus Torvalds committed Dec 21, 2006
1 parent 6a844fd commit 1d8f65a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 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: 9bfb18392ef586467277fa25d8f3a7a93611f6df
refs/heads/master: 46d2277c796f9f4937bfa668c40b2e3f43e93dd0
18 changes: 1 addition & 17 deletions trunk/fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2834,7 +2834,7 @@ int try_to_free_buffers(struct page *page)
int ret = 0;

BUG_ON(!PageLocked(page));
if (PageWriteback(page))
if (PageDirty(page) || PageWriteback(page))
return 0;

if (mapping == NULL) { /* can this still happen? */
Expand All @@ -2845,22 +2845,6 @@ int try_to_free_buffers(struct page *page)
spin_lock(&mapping->private_lock);
ret = drop_buffers(page, &buffers_to_free);
spin_unlock(&mapping->private_lock);
if (ret) {
/*
* If the filesystem writes its buffers by hand (eg ext3)
* then we can have clean buffers against a dirty page. We
* clean the page here; otherwise later reattachment of buffers
* could encounter a non-uptodate page, which is unresolvable.
* This only applies in the rare case where try_to_free_buffers
* succeeds but the page is not freed.
*
* Also, during truncate, discard_buffer will have marked all
* the page's buffers clean. We discover that here and clean
* the page also.
*/
if (test_clear_page_dirty(page))
task_io_account_cancelled_write(PAGE_CACHE_SIZE);
}
out:
if (buffers_to_free) {
struct buffer_head *bh = buffers_to_free;
Expand Down

0 comments on commit 1d8f65a

Please sign in to comment.