linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	jack@suse.cz, tytso@mit.edu
Subject: Re: [PATCH 1/2] ext4: force block allocation on quota_off
Date: Tue, 1 Jun 2010 14:11:08 +0200	[thread overview]
Message-ID: <20100601121107.GE4275@quack.suse.cz> (raw)
In-Reply-To: <1275377988-4299-1-git-send-email-dmonakhov@openvz.org>

On Tue 01-06-10 11:39:47, Dmitry Monakhov wrote:
> Perform full sync procedure to guarantee quota consistency.
  The patch looks OK to me. Acked-by: Jan Kara <jack@suse.cz>
Ted, will you merge it or should I do it?

							Honza
> 
> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
> ---
>  fs/ext4/super.c |   15 ++++++++++++++-
>  1 files changed, 14 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 4e8983a..107fb03 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -1065,6 +1065,7 @@ static int ext4_mark_dquot_dirty(struct dquot *dquot);
>  static int ext4_write_info(struct super_block *sb, int type);
>  static int ext4_quota_on(struct super_block *sb, int type, int format_id,
>  				char *path);
> +static int ext4_quota_off(struct super_block *sb, int type);
>  static int ext4_quota_on_mount(struct super_block *sb, int type);
>  static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data,
>  			       size_t len, loff_t off);
> @@ -1086,7 +1087,7 @@ static const struct dquot_operations ext4_quota_operations = {
>  
>  static const struct quotactl_ops ext4_qctl_operations = {
>  	.quota_on	= ext4_quota_on,
> -	.quota_off	= dquot_quota_off,
> +	.quota_off	= ext4_quota_off,
>  	.quota_sync	= dquot_quota_sync,
>  	.get_info	= dquot_get_dqinfo,
>  	.set_info	= dquot_set_dqinfo,
> @@ -3981,6 +3982,18 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id,
>  	return err;
>  }
>  
> +static int ext4_quota_off(struct super_block *sb, int type)
> +{
> +	/* Force all delayed allocation blocks to be allocated */
> +	if (test_opt(sb, DELALLOC)) {
> +		down_read(&sb->s_umount);
> +		sync_filesystem(sb);
> +		up_read(&sb->s_umount);
> +	}
> +
> +	return dquot_quota_off(sb, type);
> +}
> +
>  /* Read data from quotafile - avoid pagecache and such because we cannot afford
>   * acquiring the locks... As quota files are never truncated and quota code
>   * itself serializes the operations (and noone else should touch the files)
> -- 
> 1.6.6.1
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  parent reply	other threads:[~2010-06-01 12:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-28 11:27 [PATCH 1/2] ext4: force block allocation on quota_off Dmitry Monakhov
2010-05-28 11:27 ` [PATCH 2/2] quota: check quota reservation on remove_dquot_ref Dmitry Monakhov
2010-05-31 19:11 ` [PATCH 1/2] ext4: force block allocation on quota_off Jan Kara
2010-06-01  7:39   ` Dmitry Monakhov
2010-06-01  7:39     ` [PATCH 2/2] quota: check quota reservation on remove_dquot_ref Dmitry Monakhov
2010-06-01 11:54       ` Jan Kara
2010-06-01 12:11     ` Jan Kara [this message]
2010-06-05 14:55       ` [PATCH 1/2] ext4: force block allocation on quota_off tytso
2010-06-06 22:36         ` 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=20100601121107.GE4275@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=dmonakhov@openvz.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@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).