From: Mingming Cao <cmm@us.ibm.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: jack@suse.cz, linux-ext4@vger.kernel.org
Subject: [PATCH] ext4: Need clear buffer_delay after page writeout for delayed allocation
Date: Sun, 01 Jun 2008 14:10:02 -0700 [thread overview]
Message-ID: <1212354602.4368.12.camel@localhost.localdomain> (raw)
In-Reply-To: <1212154769-16486-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
ext4: Need clear buffer_delay after page writeout for delayed allocation
From: Mingming Cao <cmm@us.ibm.com>
Need clear buffer_delay in ext4_da_writepage() after page has been writeout
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
---
fs/ext4/inode.c | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
Index: linux-2.6.26-rc4/fs/ext4/inode.c
===================================================================
--- linux-2.6.26-rc4.orig/fs/ext4/inode.c 2008-06-01 13:39:14.000000000 -0700
+++ linux-2.6.26-rc4/fs/ext4/inode.c 2008-06-01 13:40:00.000000000 -0700
@@ -1495,6 +1495,13 @@ static int ext4_bh_unmapped_or_delay(han
return (!buffer_mapped(bh) || buffer_delay(bh));
}
+static int ext4_bh_clear_delay(handle_t *handle, struct buffer_head *bh)
+{
+ clear_buffer_delay(bh);
+ return 1;
+}
+
+
/* FIXME!! only support data=writeback mode */
/*
* get called vi ext4_da_writepages after taking page lock
@@ -1508,10 +1515,16 @@ static int ext4_da_writepage(struct page
loff_t size;
unsigned long len;
handle_t *handle = NULL;
- struct buffer_head *page_bufs;
+ struct buffer_head *page_bufs = page_buffers(page);
struct inode *inode = page->mapping->host;
+ size = i_size_read(inode);
+ if (page->index == size >> PAGE_CACHE_SHIFT)
+ len = size & ~PAGE_CACHE_MASK;
+ else
+ len = PAGE_CACHE_SIZE;
handle = ext4_journal_current_handle();
+
if (!handle) {
/*
* This can happen when we aren't called via
@@ -1519,14 +1532,6 @@ static int ext4_da_writepage(struct page
* We cannot easily start a transaction here so we just skip
* writing the page in case we would have to do so.
*/
- size = i_size_read(inode);
-
- page_bufs = page_buffers(page);
- if (page->index == size >> PAGE_CACHE_SHIFT)
- len = size & ~PAGE_CACHE_MASK;
- else
- len = PAGE_CACHE_SIZE;
-
if (walk_page_buffers(NULL, page_bufs, 0,
len, NULL, ext4_bh_unmapped_or_delay)) {
/*
@@ -1544,7 +1549,9 @@ static int ext4_da_writepage(struct page
ret = nobh_writepage(page, ext4_da_get_block_write, wbc);
else
ret = block_write_full_page(page, ext4_da_get_block_write, wbc);
next prev parent reply other threads:[~2008-06-01 21:10 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-30 13:39 [PATCH -v2] delalloc and journal locking order inversion fixes Aneesh Kumar K.V
2008-05-30 13:39 ` [PATCH] ext4: Use page_mkwrite vma_operations to get mmap write notification Aneesh Kumar K.V
2008-05-30 13:39 ` [PATCH] ext4: Inverse locking order of page_lock and transaction start Aneesh Kumar K.V
2008-05-30 13:39 ` [PATCH] vfs: Move mark_inode_dirty() from under page lock in generic_write_end() Aneesh Kumar K.V
2008-05-30 13:39 ` [PATCH] ext4: Add validation to jbd lock inversion patch and split and writepage Aneesh Kumar K.V
2008-05-30 13:39 ` [PATCH] ext4: inverse locking ordering of page_lock and transaction start in delalloc Aneesh Kumar K.V
2008-05-30 13:39 ` [PATCH] ext4: Fix delalloc sync hang with journal lock inversion Aneesh Kumar K.V
2008-06-02 9:35 ` Jan Kara
2008-06-02 9:59 ` Aneesh Kumar K.V
2008-06-02 10:27 ` Jan Kara
2008-06-05 13:54 ` Aneesh Kumar K.V
2008-06-05 16:22 ` Jan Kara
2008-06-05 19:19 ` Aneesh Kumar K.V
2008-06-11 12:41 ` Jan Kara
2008-06-11 13:56 ` Aneesh Kumar K.V
2008-06-11 17:48 ` Jan Kara
2008-06-12 23:10 ` Mingming Cao
2008-06-02 9:31 ` [PATCH] ext4: Add validation to jbd lock inversion patch and split and writepage Jan Kara
2008-06-02 9:52 ` Aneesh Kumar K.V
2008-06-02 10:40 ` Jan Kara
2008-05-30 17:51 ` [PATCH -v2] delalloc and journal locking order inversion fixes Mingming
2008-06-01 21:10 ` Mingming Cao [this message]
2008-06-02 3:14 ` [PATCH] ext4: Need clear buffer_delay after page writeout for delayed allocation Aneesh Kumar K.V
2008-06-02 3:50 ` Mingming Cao
2008-06-02 4:09 ` Aneesh Kumar K.V
2008-06-02 5:38 ` Mingming Cao
2008-06-02 6:35 ` Aneesh Kumar K.V
2008-06-02 7:04 ` Mingming Cao
2008-06-02 8:05 ` Aneesh Kumar K.V
2008-06-03 4:43 ` Mingming Cao
2008-06-03 10:07 ` Aneesh Kumar K.V
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1212354602.4368.12.camel@localhost.localdomain \
--to=cmm@us.ibm.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox