linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu, jack@suse.cz
Subject: Re: [PATCH 2/2] ext4: init statistics after journal recovery v2
Date: Mon, 12 Apr 2010 21:37:29 +0200	[thread overview]
Message-ID: <20100412193728.GP3404@quack.suse.cz> (raw)
In-Reply-To: <1271099576-7507-2-git-send-email-dmonakhov@openvz.org>

On Mon 12-04-10 23:12:56, Dmitry Monakhov wrote:
> Currently block/inode/dir counters initialized before journal was
> recovered. In fact after journal recovery this info will probably
> change. And freeblocks it critical for correct delalloc mode
> accounting.
> BUG:#15768
  This patch looks fine. Acked-by: Jan Kara <jack@suse.cz>

								Honza
> 
> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
> ---
>  fs/ext4/super.c |   44 ++++++++++++++++++++++----------------------
>  1 files changed, 22 insertions(+), 22 deletions(-)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 29c6875..04a30ef 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -2793,24 +2793,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
>  	get_random_bytes(&sbi->s_next_generation, sizeof(u32));
>  	spin_lock_init(&sbi->s_next_gen_lock);
>  
> -	err = percpu_counter_init(&sbi->s_freeblocks_counter,
> -			ext4_count_free_blocks(sb));
> -	if (!err) {
> -		err = percpu_counter_init(&sbi->s_freeinodes_counter,
> -				ext4_count_free_inodes(sb));
> -	}
> -	if (!err) {
> -		err = percpu_counter_init(&sbi->s_dirs_counter,
> -				ext4_count_dirs(sb));
> -	}
> -	if (!err) {
> -		err = percpu_counter_init(&sbi->s_dirtyblocks_counter, 0);
> -	}
> -	if (err) {
> -		ext4_msg(sb, KERN_ERR, "insufficient memory");
> -		goto failed_mount3;
> -	}
> -
>  	sbi->s_stripe = ext4_get_stripe_size(sbi);
>  	sbi->s_max_writeback_mb_bump = 128;
>  
> @@ -2910,6 +2892,24 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
>  	set_task_ioprio(sbi->s_journal->j_task, journal_ioprio);
>  
>  no_journal:
> +	err = percpu_counter_init(&sbi->s_freeblocks_counter,
> +			ext4_count_free_blocks(sb));
> +	if (!err) {
> +		err = percpu_counter_init(&sbi->s_freeinodes_counter,
> +				ext4_count_free_inodes(sb));
> +	}
> +	if (!err) {
> +		err = percpu_counter_init(&sbi->s_dirs_counter,
> +				ext4_count_dirs(sb));
> +	}
> +	if (!err) {
> +		err = percpu_counter_init(&sbi->s_dirtyblocks_counter, 0);
> +	}
> +	if (err) {
> +		ext4_msg(sb, KERN_ERR, "insufficient memory");
> +		goto failed_mount_wq;
> +	}
> +
>  	if (test_opt(sb, NOBH)) {
>  		if (!(test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA)) {
>  			ext4_msg(sb, KERN_WARNING, "Ignoring nobh option - "
> @@ -3059,6 +3059,10 @@ failed_mount_wq:
>  		jbd2_journal_destroy(sbi->s_journal);
>  		sbi->s_journal = NULL;
>  	}
> +	percpu_counter_destroy(&sbi->s_freeblocks_counter);
> +	percpu_counter_destroy(&sbi->s_freeinodes_counter);
> +	percpu_counter_destroy(&sbi->s_dirs_counter);
> +	percpu_counter_destroy(&sbi->s_dirtyblocks_counter);
>  failed_mount3:
>  	if (sbi->s_flex_groups) {
>  		if (is_vmalloc_addr(sbi->s_flex_groups))
> @@ -3066,10 +3070,6 @@ failed_mount3:
>  		else
>  			kfree(sbi->s_flex_groups);
>  	}
> -	percpu_counter_destroy(&sbi->s_freeblocks_counter);
> -	percpu_counter_destroy(&sbi->s_freeinodes_counter);
> -	percpu_counter_destroy(&sbi->s_dirs_counter);
> -	percpu_counter_destroy(&sbi->s_dirtyblocks_counter);
>  failed_mount2:
>  	for (i = 0; i < db_count; i++)
>  		brelse(sbi->s_group_desc[i]);
> -- 
> 1.6.6.1
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2010-04-12 19:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-12 19:12 [PATCH 1/2] ext3: init statistics after journal recovery Dmitry Monakhov
2010-04-12 19:12 ` [PATCH 2/2] ext4: init statistics after journal recovery v2 Dmitry Monakhov
2010-04-12 19:37   ` Jan Kara [this message]
2010-04-21 20:03     ` tytso
2010-04-12 19:30 ` [PATCH 1/2] ext3: init statistics after journal recovery Jan Kara
2010-04-12 19:34   ` Dmitry Monakhov
2010-04-12 19:46   ` [PATCH 1/2] ext3: init statistics after journal recovery v2 Dmitry Monakhov
2010-04-13 14:26     ` Jan Kara

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=20100412193728.GP3404@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=dmonakhov@openvz.org \
    --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).