From: Jan Kara <jack@suse.cz>
To: Kazuya Mio <k-mio@sx.jp.nec.com>
Cc: ext4 <linux-ext4@vger.kernel.org>, Jan Kara <jack@suse.cz>,
Andreas Dilger <adilger@dilger.ca>
Subject: Re: [PATCH 1/2] ext3: Don't call dquot_free_block() if we don't update anything
Date: Thu, 2 Feb 2012 17:01:18 +0100 [thread overview]
Message-ID: <20120202160118.GI31730@quack.suse.cz> (raw)
In-Reply-To: <4F2657B5.9050100@sx.jp.nec.com>
On Mon 30-01-12 17:41:25, Kazuya Mio wrote:
> dquot_free_block() is called in the end of ext3_new_blocks() and updates
> information of the inode structure. However, this update is not necessary
> if the number of blocks we requested is equal to the number of
> allocated blocks.
This is obviously correct thing to do so I've merged this patch into
my tree. Thanks.
Honza
>
> Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
> ---
> fs/ext3/balloc.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
> diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
> index a203892..954a7d3 100644
> --- a/fs/ext3/balloc.c
> +++ b/fs/ext3/balloc.c
> @@ -1743,8 +1743,11 @@ allocated:
>
> *errp = 0;
> brelse(bitmap_bh);
> - dquot_free_block(inode, *count-num);
> - *count = num;
> +
> + if (num < *count) {
> + dquot_free_block(inode, *count-num);
> + *count = num;
> + }
>
> trace_ext3_allocate_blocks(inode, goal, num,
> (unsigned long long)ret_block);
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
prev parent reply other threads:[~2012-02-02 16:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-30 8:41 [PATCH 1/2] ext3: Don't call dquot_free_block() if we don't update anything Kazuya Mio
2012-02-02 16:01 ` Jan Kara [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=20120202160118.GI31730@quack.suse.cz \
--to=jack@suse.cz \
--cc=adilger@dilger.ca \
--cc=k-mio@sx.jp.nec.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;
as well as URLs for NNTP newsgroup(s).