On Tue, Oct 15, 2013 at 8:34 PM, Jan Kara <jack@xxxxxxx> wrote: > On Tue 15-10-13 19:15:56, Ming Lei wrote: >> > This won't quite work because if the page is fully mapped >> > mpage_process_page_bufs() will immediately submit the page and decrease >> > nr_to_write. So now you would end up writing less than you were asked for >> > in some cases. >> >> Yes, your are right, so how about below? >> >> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c >> index 32c04ab..3cf7abb 100644 >> --- a/fs/ext4/inode.c >> +++ b/fs/ext4/inode.c >> @@ -2295,6 +2295,7 @@ static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd) >> struct address_space *mapping = mpd->inode->i_mapping; >> struct pagevec pvec; >> unsigned int nr_pages; >> + int left = mpd->wbc->nr_to_write; > 'long' please. Otherwise the patch looks fine. Thanks! OK, and I will submit the formal one with you ack. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html