Cluster-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] Re: GFS2: Allow all meta/normal mount combinations
Date: Fri, 5 Jun 2009 10:09:18 -0400	[thread overview]
Message-ID: <20090605140918.GA14060@infradead.org> (raw)
In-Reply-To: <1244209936.29604.696.camel@localhost.localdomain>

On Fri, Jun 05, 2009 at 02:52:16PM +0100, Steven Whitehouse wrote:
> +static int gfs2_get_sb(struct file_system_type *fs_type, int flags,
> +		       const char *dev_name, void *data, struct vfsmount *mnt)
> +{
> +	struct super_block *s;
> +	struct gfs2_sbd *sdp;
> +	int ret;
> +
> +	/* First we assume its a block device */
> +	ret = get_sb_bdev(fs_type, flags, dev_name, data, fill_super, mnt);
> +	if (ret != -ENOTBLK)
> +		return ret;
> +
> +	/* If that fails, we assume its a GFS2 inode on an existing sb */
> +	s = get_gfs2_sb(dev_name);
> +	if (IS_ERR(s)) {
> +		printk(KERN_WARNING "GFS2: gfs2 mount does not exist\n");
> +		return PTR_ERR(s);
> +	}

This is pretty ugly.  Even if this is how the old gfs2meta filesystem
worked I would prefer to only allow it if mounted as type gfs2meta, not
for normal gfs2 mount and gradually phase it out.

> +	sdp = s->s_fs_info;
> +	mnt->mnt_sb = s;
> +	mnt->mnt_root = gfs2_is_meta_fs(data) ? dget(sdp->sd_master_dir) :
> +						dget(sdp->sd_root_dir);

	if (gfs2_is_meta_fs(data))
		mnt->mnt_root = dget(sdp->sd_master_dir);
	else
		mnt->mnt_root = dget(sdp->sd_root_dir);

would be a lot more readable..



  reply	other threads:[~2009-06-05 14:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-05 13:52 [Cluster-devel] GFS2: Allow all meta/normal mount combinations Steven Whitehouse
2009-06-05 14:09 ` Christoph Hellwig [this message]
2009-06-05 14:17   ` [Cluster-devel] " Steven Whitehouse
2009-06-08 16:12     ` Christoph Hellwig
2009-06-08 16:17       ` Steven Whitehouse

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=20090605140918.GA14060@infradead.org \
    --to=hch@infradead.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