All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Fasheh <mark.fasheh@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 2/2] Enable cross extent block merge.V1
Date: Sun Jan  6 22:00:36 2008	[thread overview]
Message-ID: <20080107055855.GU23506@ca-server1.us.oracle.com> (raw)
In-Reply-To: <20080104084619.GA1955@tma-pc1.cn.oracle.com>

On Fri, Jan 04, 2008 at 04:46:19PM +0800, tao.ma wrote:
>  static enum ocfs2_contig_type
> -ocfs2_figure_merge_contig_type(struct inode *inode,
> +ocfs2_figure_merge_contig_type(struct inode *inode, struct ocfs2_path *path,
>  			       struct ocfs2_extent_list *el, int index,
>  			       struct ocfs2_extent_rec *split_rec)
>  {
> -	struct ocfs2_extent_rec *rec;
> +	int status;
> +	struct ocfs2_extent_rec *rec = NULL;
>  	enum ocfs2_contig_type ret = CONTIG_NONE;
> +	u32 left_cpos, right_cpos;
> +	struct ocfs2_extent_list *new_el;
> +	struct ocfs2_path *left_path = NULL, *right_path = NULL;
> +
> +	if (index > 0) {
> +		rec = &el->l_recs[index - 1];
> +	} else if (path->p_tree_depth > 0) {
> +		status = ocfs2_find_cpos_for_left_leaf(inode->i_sb,
> +						       path, &left_cpos);
> +		if (status)
> +			goto out;
> +
> +		if (left_cpos != 0) {
> +			left_path = ocfs2_new_path(path_root_bh(path),
> +						   path_root_el(path));
> +			if (!left_path)
> +				goto out;
> +
> +			status = ocfs2_find_path(inode, left_path, left_cpos);
> +			if (status)
> +				goto out;
> +
> +			new_el = path_leaf_el(left_path);
> +
> +			BUG_ON(le16_to_cpu(new_el->l_next_free_rec) !=
> +			       le16_to_cpu(new_el->l_count));

Since we haven't seen this extent block before, this error condition should
make the file system go read-only, not BUG()


> +			rec = &new_el->l_recs[le16_to_cpu(new_el->l_count) - 1];

Use l_next_free_rec in the array here please.
	--Mark

--
Mark Fasheh
Principal Software Developer, Oracle
mark.fasheh@oracle.com

  reply	other threads:[~2008-01-06 22:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-04  0:33 [Ocfs2-devel] [PATCH 0/2] Unwritten extent merge update,V1 Tao Ma
2008-01-04  0:45 ` [Ocfs2-devel] [PATCH 1/2] Add support for cross extent block merge.V1 Tao Ma
2008-01-06 21:52   ` Mark Fasheh
2008-01-07  1:06     ` tao.ma
2008-01-10 17:48       ` Mark Fasheh
2008-01-10 18:21         ` tao.ma
2008-01-04  0:47 ` [Ocfs2-devel] [PATCH 2/2] Enable " Tao Ma
2008-01-06 22:00   ` Mark Fasheh [this message]
2008-01-06 13:44 ` [Ocfs2-devel] [PATCH 0/2] Unwritten extent merge update,V1 Mark Fasheh

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=20080107055855.GU23506@ca-server1.us.oracle.com \
    --to=mark.fasheh@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.