From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Price Date: Tue, 19 Mar 2019 17:53:07 +0000 Subject: [Cluster-devel] [PATCH v2 1/2] gfs2: Convert gfs2 to fs_context In-Reply-To: <11353.1553015136@warthog.procyon.org.uk> References: <20190319160436.20817-2-anprice@redhat.com> <20190319160436.20817-1-anprice@redhat.com> <11353.1553015136@warthog.procyon.org.uk> Message-ID: <040cfbf7-9f27-b90b-262d-15a4e07eab32@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 19/03/2019 17:05, David Howells wrote: > Andrew Price wrote: > >> + pr_warn("-o debug and -o errors=panic are mutually exclusive\n"); >> + return -EINVAL; > > return invalf(fc, "gfs2: -o debug and -o errors=panic are mutually exclusive"); Thanks. > > (Note: no "\n") > >> + if (result.int_32 > 0) >> + args->ar_quota = opt_quota_values[result.int_32]; >> + else if (result.negated) >> + args->ar_quota = GFS2_QUOTA_OFF; >> + else >> + args->ar_quota = GFS2_QUOTA_ON; > > I recommend checking result.negated first. OK > >> + /* Not allowed to change locking details */ >> + if (strcmp(newargs->ar_lockproto, oldargs->ar_lockproto) || >> + strcmp(newargs->ar_locktable, oldargs->ar_locktable) || >> + strcmp(newargs->ar_hostdata, oldargs->ar_hostdata)) >> + return -EINVAL; > > Use errorf(). (Not invalf - the parameter isn't exactly invalid, it's just > that you're not allowed to do this operation). Yes, that makes more sense. >> + error = gfs2_make_fs_ro(sdp); >> + else >> + error = gfs2_make_fs_rw(sdp); >> + if (error) >> + return error; > > Might want to call errorf() here too. > >> - s = sget(&gfs2_fs_type, test_gfs2_super, set_meta_super, flags, >> + s = sget(&gfs2_fs_type, test_meta_super, set_meta_super, flags, > > Try and use sget_fc() please. That happens in patch 2/2 for gfs2meta. I might just roll both patches together in v3 so there's no intermediate churn. > If you look at the fuse patchset I cc'd you on, > there's a commit there that adds a ->bdev and ->bdev_mode to fs_context that > may be of use to you. Yes, that looks useful - thanks. > Can you use vfs_get_block_super()? It might be possible if we can rearrange things so that this can be done outside of the function: if (args->ar_meta) fc->root = dget(sdp->sd_master_dir); else fc->root = dget(sdp->sd_root_dir); but we can't do that in our fill_super() because it needs to be selected whether we have an existing mount or not. > Would it be of use to export > test_bdev_super_fc() and set_bdev_super_fc()? There's only a little maintenance value in it, I think, but we could certainly use them in gfs2 if we can't solve the fc->root selection issue. Andy