mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Mingming Cao <cmm@us.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [Patch] ext3_new_inode() failure case fix
Date: Tue, 21 Sep 2004 23:01:24 -0700	[thread overview]
Message-ID: <20040921230124.368e469c.akpm@osdl.org> (raw)
In-Reply-To: <1095815041.1637.32926.camel@w-ming2.beaverton.ibm.com>

Mingming Cao <cmm@us.ibm.com> wrote:
>
> While I am studying ext3_new_inode() failure code paths, I found the
> inode->i_nlink is not cleared to 0 in the first failure path. But it is
> cleared to 0 in the second failure path(fail to allocate disk quota). I
> think it should be cleared in both cases, because later when
> generic_drop_inode() is called by iput(), i_nlink is checked to decide
> whether to call generic_delete_inode(). Currently it is calling
> generic_forget_inode().
> 
> Also the reference to the inode bitmap buffer head should be dropped on
> the failure path too.

That reference already is dropped:

> --- linux-2.6.9-rc1-mm5/fs/ext3/ialloc.c~ext3_new_inode_failure_case_fix	2004-09-22 00:18:18.196012520 -0700
> +++ linux-2.6.9-rc1-mm5-ming/fs/ext3/ialloc.c	2004-09-22 00:19:20.063607216 -0700
> @@ -622,7 +622,9 @@ got:
>  fail:
>  	ext3_std_error(sb, err);
>  out:
> +	inode->i_nlink = 0;
>  	iput(inode);
> +	brelse(bitmap_bh);
>  	ret = ERR_PTR(err);
>  really_out:
>  	brelse(bitmap_bh);

        ^ here

So I'll drop that part of the patch.

  reply	other threads:[~2004-09-22  6:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-07 13:02 [Patch 0/6]: Cleanup and rbtree for ext3 reservations in 2.6.9-rc1-mm4 Stephen Tweedie
2004-09-11  0:34 ` Mingming Cao
2004-09-12  7:59   ` Ram Pai
2004-09-22  1:04 ` [Patch] ext3_new_inode() failure case fix Mingming Cao
2004-09-22  6:01   ` Andrew Morton [this message]
2004-09-22  7:29     ` viro

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=20040921230124.368e469c.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=cmm@us.ibm.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®