public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: akpm@linux-foundation.org, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext4: Check for the correct error return from ext4_ext_get_blocks
Date: Mon, 03 Dec 2007 09:37:37 -0600	[thread overview]
Message-ID: <475422C1.2030906@redhat.com> (raw)
In-Reply-To: <1196677650-10479-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

Aneesh Kumar K.V wrote:
> ext4_ext_get_blocks returns negative values on error. We should
> check for  <= 0
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
>  fs/ext4/extents.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index a2475d4..ce57245 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -2558,8 +2558,8 @@ retry:
>  		ret = ext4_ext_get_blocks(handle, inode, block,
>  					  max_blocks, &map_bh,
>  					  EXT4_CREATE_UNINITIALIZED_EXT, 0);
> -		WARN_ON(!ret);
> -		if (!ret) {
> +		WARN_ON(ret <= 0);
> +		if (ret <= 0) {
>  			ext4_error(inode->i_sb, "ext4_fallocate",
>  				   "ext4_ext_get_blocks returned 0! inode#%lu"
>  				   ", block=%llu, max_blocks=%llu",

Need to change the "returned 0!" part of the error to "returned %d!"
then too, I guess?

-Eric

      reply	other threads:[~2007-12-03 15:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-03 10:27 [PATCH] ext4: Check for the correct error return from ext4_ext_get_blocks Aneesh Kumar K.V
2007-12-03 15:37 ` Eric Sandeen [this message]

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=475422C1.2030906@redhat.com \
    --to=sandeen@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --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