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