linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: cmm@us.ibm.com, tytso@mit.edu, sandeen@redhat.com
Cc: linux-ext4@vger.kernel.org,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: [PATCH] ext4: Return error if we fail to allocate block in noalloc_get_block_write
Date: Wed,  1 Jul 2009 15:16:15 +0530	[thread overview]
Message-ID: <1246441575-20311-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> (raw)

block_write_full_page consider a zero return from get_block as success.
noalloc_get_block_write returned zero even if we failed to find a mapping
blocks. Returning non zero ensures we fallback to the error handling path
of block_write_full_page which would properly redirty the page after
the below patch is applied.

http://article.gmane.org/gmane.linux.file-systems/33145

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---

NOTE: I am not sure whether -EGAIN is the right error to be returned error.
This patch should enable us to push the pending ext4 patches in the patch
queue without depending on the full series from Jan. Will reply to this
email with patch ordering.

 fs/ext4/inode.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 25638bc..6c814af 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2514,7 +2514,10 @@ static int noalloc_get_block_write(struct inode *inode, sector_t iblock,
 	if (ret > 0) {
 		bh_result->b_size = (ret << inode->i_blkbits);
 		ret = 0;
-	}
+	} else if (create && ret == 0)
+		/* write request on unmapped buffer head. */
+		ret = -EAGAIN;
+
 	return ret;
 }
 
-- 
1.6.3.2.363.gc5764


             reply	other threads:[~2009-07-01  9:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-01  9:46 Aneesh Kumar K.V [this message]
2009-07-01  9:56 ` [PATCH] ext4: Return error if we fail to allocate block in noalloc_get_block_write Aneesh Kumar K.V
2009-07-07 17:18   ` Jan Kara
2009-07-07  9:20 ` 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=1246441575-20311-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=cmm@us.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --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).