[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] Re: GFS2: Allow all meta/normal mount combinations



Hi,

On Fri, 2009-06-05 at 10:09 -0400, Christoph Hellwig wrote:
> 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.
> 
Which bit is ugly? We need to be able to do this to be sure that we can
get a metafs which exactly matches the "normal" fs without races I
think. Thats a requirement of the userland tools, unfortunately.

> > +	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..
Yes, thats true. I'll fix it,

Steve.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]