From: Mingming <cmm@us.ibm.com>
To: tytso@mit.edu
Cc: ext4 development <linux-ext4@vger.kernel.org>,
Curt Wohlgemuth <curtw@google.com>
Subject: Re: [PATCH 2/2]Fix return value of splitting extents for dio write over fallocate
Date: Wed, 07 Oct 2009 11:50:29 -0700 [thread overview]
Message-ID: <1254941429.18662.8.camel@mingming-laptop> (raw)
In-Reply-To: <1254936214.18662.7.camel@mingming-laptop>
On Wed, 2009-10-07 at 10:23 -0700, Mingming wrote:
> ext4: Fix return value of splitting extents for dio write over fallocate
Please pick up this patch instead, after fixing compile warning.
ext4: Fix return value of splitting extents for dio write over fallocate
To prepare direct IO write, we need to split the unwritten extents before
submit the IO. In case of no split needs at all, ext4_split_unwritten_extents()
was incorrectly returns 0 instead of the size of uninitalized extents. This bug
caused wrong return value sent back to VFS code when it gets called from async
IO path, leads to falling back to buffered IO.
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
---
fs/ext4/extents.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Index: linux-2.6.31-rc4/fs/ext4/extents.c
===================================================================
--- linux-2.6.31-rc4.orig/fs/ext4/extents.c
+++ linux-2.6.31-rc4/fs/ext4/extents.c
@@ -2788,6 +2788,8 @@ fix_extent_len:
* into three uninitialized extent(at most). After IO complete, the part
* being filled will be convert to initialized by the end_io callback function
* via ext4_convert_unwritten_extents().
+ *
+ * Returns the size of unitialized extent to be writen, on success.
*/
static int ext4_split_unwritten_extents(handle_t *handle,
struct inode *inode,
@@ -2805,7 +2807,6 @@ static int ext4_split_unwritten_extents(
unsigned int allocated, ee_len, depth;
ext4_fsblk_t newblock;
int err = 0;
- int ret = 0;
unsigned int newdepth;
ext_debug("ext4_split_unwritten_extents: inode %lu,"
@@ -2829,7 +2830,7 @@ static int ext4_split_unwritten_extents(
* uninitialized extent
*/
if (allocated <= max_blocks)
- return ret;
+ return allocated;
err = ext4_ext_get_access(handle, inode, path + depth);
if (err)
next prev parent reply other threads:[~2009-10-07 18:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-07 17:23 [PATCH 2/2]Fix return value of splitting extents for dio write over fallocate Mingming
2009-10-07 18:50 ` Mingming [this message]
2009-10-08 23:08 ` Mingming
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=1254941429.18662.8.camel@mingming-laptop \
--to=cmm@us.ibm.com \
--cc=curtw@google.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).