From: Jeff Liu <jeff.liu@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] Add bits_wanted while calculating credits in ocfs2_calc_extend_credits
Date: Mon, 17 Jun 2013 22:40:32 +0800 [thread overview]
Message-ID: <51BF1FE0.9040500@oracle.com> (raw)
In-Reply-To: <20130617140824.GA8554@shrek.cartoons>
On 06/17/2013 10:08 PM, Goldwyn Rodrigues wrote:
> While adding extends to a file, the credits are calculated incorrectly
> and if the requested clusters is more than one (or more because we used
> a conservative limit) then we run out of journal credits and we hit
> an assert in journalling code.
>
> The function parameter bits_wanted variable was not used at all.
>
> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Looks good to me, thank you!
Reviewed-by: Jie Liu <jeff.liu@oracle.com>
>
> ---
> diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h
> index a3385b6..7d927cd 100644
> --- a/fs/ocfs2/journal.h
> +++ b/fs/ocfs2/journal.h
> @@ -538,7 +538,7 @@ static inline int ocfs2_calc_extend_credits(struct super_block *sb,
> extent_blocks = 1 + 1 + le16_to_cpu(root_el->l_tree_depth);
>
> return bitmap_blocks + sysfile_bitmap_blocks + extent_blocks +
> - ocfs2_quota_trans_credits(sb);
> + ocfs2_quota_trans_credits(sb) + bits_wanted;
> }
>
> static inline int ocfs2_calc_symlink_credits(struct super_block *sb)
>
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/ocfs2-devel
prev parent reply other threads:[~2013-06-17 14:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-17 14:08 [Ocfs2-devel] [PATCH] Add bits_wanted while calculating credits in ocfs2_calc_extend_credits Goldwyn Rodrigues
2013-06-17 14:40 ` Jeff Liu [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=51BF1FE0.9040500@oracle.com \
--to=jeff.liu@oracle.com \
--cc=ocfs2-devel@oss.oracle.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.