From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Whitehouse Date: Fri, 05 Jun 2009 15:17:43 +0100 Subject: [Cluster-devel] Re: GFS2: Allow all meta/normal mount combinations In-Reply-To: <20090605140918.GA14060@infradead.org> References: <1244209936.29604.696.camel@localhost.localdomain> <20090605140918.GA14060@infradead.org> Message-ID: <1244211463.29604.698.camel@localhost.localdomain> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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.