linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ext4: let mpage_submit_io works well when blocksize < pagesize
@ 2011-11-23  9:15 Yongqiang Yang
  2011-11-23  9:15 ` [PATCH 2/2] ext4: let ext4_discard_partial_buffers handle pages without buffers correctly Yongqiang Yang
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Yongqiang Yang @ 2011-11-23  9:15 UTC (permalink / raw)
  To: linux-ext4; +Cc: achender, tytso, Yongqiang Yang

If there is a unwritten but clean buffer in a page and there is a dirty buffer
after the buffer, then mpage_submit_io does not write the dirty buffer out.
As a result, da_writepages loops forever.

This patch fixes the problem by checking dirty flag.

Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
---
 fs/ext4/inode.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 755f6c7..20a1d17 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1339,8 +1339,11 @@ static int mpage_da_submit_io(struct mpage_da_data *mpd,
 					clear_buffer_unwritten(bh);
 				}
 
-				/* skip page if block allocation undone */
-				if (buffer_delay(bh) || buffer_unwritten(bh))
+				/*
+				 * skip page if block allocation undone and
+				 * block is dirty
+				 */
+				if (ext4_bh_delay_or_unwritten(NULL, bh))
 					skip_page = 1;
 				bh = bh->b_this_page;
 				block_start += bh->b_size;
-- 
1.7.5.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-12-14  3:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-23  9:15 [PATCH 1/2] ext4: let mpage_submit_io works well when blocksize < pagesize Yongqiang Yang
2011-11-23  9:15 ` [PATCH 2/2] ext4: let ext4_discard_partial_buffers handle pages without buffers correctly Yongqiang Yang
2011-12-14  3:05   ` Ted Ts'o
2011-11-26 15:08 ` [PATCH 1/2] ext4: let mpage_submit_io works well when blocksize < pagesize Tao Ma
     [not found]   ` <CAGBYx2a_Xm5e3ESuh2YpBpcrEM4j5_TPegQC3WO1yQVtmqJ2Pw@mail.gmail.com>
2011-11-26 15:22     ` Tao Ma
     [not found]       ` <CAGBYx2apFEheGGtJWeLeKKGBWeq849AW6+wwqvEopM0PeJQd=w@mail.gmail.com>
2011-11-27  8:59         ` Tao Ma
2011-12-01 20:13 ` Allison Henderson
2011-12-02  1:15   ` Yongqiang Yang
2011-12-02  6:46     ` Allison Henderson
2011-12-14  3:05 ` Ted Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).