From: Jan Kara <jack@suse.cz>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Jan Kara <jack@suse.cz>, linux-ext4@vger.kernel.org
Subject: Re: [PATCH 2/2] ext4: Move quota initialization out of inode allocation transaction
Date: Thu, 18 Apr 2013 23:46:31 +0200 [thread overview]
Message-ID: <20130418214631.GA19244@quack.suse.cz> (raw)
In-Reply-To: <20130418190738.GB5588@thunk.org>
On Thu 18-04-13 15:07:38, Ted Tso wrote:
> On Tue, Apr 09, 2013 at 12:42:37PM -0400, Theodore Ts'o wrote:
> >
> > Thanks, added to the dev branch for testing.
> >
>
> This patch was causing a reliable failure for xfstests generic/083
> using bigalloc. I bisected down this patch, and then localized the
> failure down to the insert_inode_locked() call in __ext4_new_inode()
> failing (which means that there is an old inode in the inode hash
> lists with the same inode number)
>
> The error seems to be caused by the error handling code paths. I
> believe the problem was caused by clear_nlink() and unlock_new_inode()
> getting called in some error cleanup paths when the inode that hadn't
> yet been inserted into inode hash lists.
>
> Here is a revamped patch which has a cleaned up set of error paths.
> The only change is in the cleanup paths, and this causes the
> generic/083 test for bigalloc to pass where it was previously failing.
Thanks for catching this. But there's a bug in the new error handling as
well:
> @@ -733,13 +750,17 @@ repeat_in_this_group:
> handle_type, nblocks);
> if (IS_ERR(handle)) {
> err = PTR_ERR(handle);
> - goto fail;
> + ext4_std_error(sb, err);
> + goto out;
> }
> +
Extra empty line...
> @@ -951,24 +972,17 @@ got:
>
> ext4_debug("allocating inode %lu\n", inode->i_ino);
> trace_ext4_allocate_inode(inode, dir, mode);
> - goto really_out;
> -fail:
> - ext4_std_error(sb, err);
> -out:
> - iput(inode);
> - ret = ERR_PTR(err);
> -really_out:
> brelse(inode_bitmap_bh);
> return ret;
>
> fail_free_drop:
> dquot_free_inode(inode);
> -
> fail_drop:
> - dquot_drop(inode);
> inode->i_flags |= S_NOQUOTA;
> clear_nlink(inode);
> unlock_new_inode(inode);
> +out:
> + dquot_drop(inode);
> iput(inode);
> brelse(inode_bitmap_bh);
> return ERR_PTR(err);
You need to move
inode->i_flags |= S_NOQUOTA;
along with dquot_drop() call as dquot_drop() will do nothing on an inode
marked with S_NOQUOTA so we leak dquot references...
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2013-04-18 21:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-09 8:34 [PATCH 1/2] ext4: Improve credit estimate for EXT4_SINGLEDATA_TRANS_BLOCKS Jan Kara
2013-04-09 8:34 ` [PATCH 2/2] ext4: Move quota initialization out of inode allocation transaction Jan Kara
2013-04-09 16:42 ` Theodore Ts'o
2013-04-18 19:07 ` Theodore Ts'o
2013-04-18 21:46 ` Jan Kara [this message]
2013-04-18 23:24 ` [PATCH -v3] ext4: move " Theodore Ts'o
2013-04-19 14:30 ` Jan Kara
2013-04-19 16:24 ` Theodore Ts'o
2013-04-19 19:21 ` Jan Kara
2013-04-09 16:42 ` [PATCH 1/2] ext4: Improve credit estimate for EXT4_SINGLEDATA_TRANS_BLOCKS Theodore Ts'o
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=20130418214631.GA19244@quack.suse.cz \
--to=jack@suse.cz \
--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).