All of lore.kernel.org
 help / color / mirror / Atom feed
From: tao.ma <tao.ma@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] 	[PATCH 2/3] Add group extend for online resize, take 2
Date: Tue Nov 27 17:34:27 2007	[thread overview]
Message-ID: <474CC527.5020209@oracle.com> (raw)
In-Reply-To: <20071127082135.GA4480@tma-pc1.cn.oracle.com>

Tao Ma wrote:
> +/*
> + * Extend the filesystem to the new number of clusters specified.  This entry
> + * point is only used to extend the current filesystem to the end of the last
> + * existing group.
> + */
> +int ocfs2_group_extend(struct inode * inode, u32 new_clusters)
> +{
> +	int ret;
> +	handle_t *handle;
> +	struct buffer_head *main_bm_bh = NULL;
> +	struct buffer_head *group_bh = NULL;
> +	struct inode *main_bm_inode = NULL;
> +	struct ocfs2_dinode *fe = NULL;
> +	struct ocfs2_group_desc *group = NULL;
> +	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
> +	u16 cl_bpc;
> +	u32 first_new_cluster;
> +	u64 lgd_blkno;
> +
> +	mlog_entry_void();
> +
> +	if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb))
> +		return -EROFS;
> +
> +	if (new_clusters == 0)
> +		return 0;
> +
> +	main_bm_inode = ocfs2_get_system_file_inode(osb,
> +						    GLOBAL_BITMAP_SYSTEM_INODE,
> +						    OCFS2_INVALID_SLOT);
> +	if (!main_bm_inode) {
> +		ret = -EINVAL;
> +		mlog_errno(ret);
> +		goto out;
> +	}
> +
> +	mutex_lock(&main_bm_inode->i_mutex);
> +
> +	ret = ocfs2_meta_lock(main_bm_inode, &main_bm_bh, 1);
> +	if (ret < 0) {
> +		mlog_errno(ret);
> +		goto out_mutex;
> +	}
> +
> +	fe = (struct ocfs2_dinode *)main_bm_bh->b_data;
> +
> +	if (le16_to_cpu(fe->id2.i_chain.cl_cpg) !=
> +				 ocfs2_group_bitmap_size(osb->sb) * 8) {
> +		mlog(0, "The disk is too old. Force to do offline resize.");
> +		ret = -EINVAL;
> +		goto out_mutex;
> +	}
>   
A bug here. It should be "goto out_unlock".
I will modify it after I collect all the feedback.

  reply	other threads:[~2007-11-27 17:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-27  0:12 [Ocfs2-devel] [PATCH 1/3] Add online resize support for ocfs2, take 2 Tao Ma
2007-11-27  0:20 ` [Ocfs2-devel] [PATCH 1/3] Initalize bitmap_cpg of ocfs2_super to be the maximum Tao Ma
2007-11-30 11:47   ` Mark Fasheh
2007-11-27  0:22 ` [Ocfs2-devel] [PATCH 3/3] Implement "GROUP_ADD" for online resize, take 2 Tao Ma
2007-11-30 15:21   ` Mark Fasheh
2007-12-02 18:08     ` tao.ma
2007-12-03 19:24       ` Mark Fasheh
2007-12-12 23:06     ` tao.ma
2007-11-27  0:23 ` [Ocfs2-devel] [PATCH 2/3] Add group extend " Tao Ma
2007-11-27 17:34   ` tao.ma [this message]
2007-11-30 11:42   ` Mark Fasheh
2007-11-30 15:43 ` [Ocfs2-devel] [PATCH 1/3] Add online resize support for ocfs2, " 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=474CC527.5020209@oracle.com \
    --to=tao.ma@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.