linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Andrew Price <anprice@redhat.com>
Cc: dhowells@redhat.com, cluster-devel@redhat.com,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] gfs2: Convert gfs2 to fs_context
Date: Tue, 19 Mar 2019 17:05:36 +0000	[thread overview]
Message-ID: <11353.1553015136@warthog.procyon.org.uk> (raw)
In-Reply-To: <20190319160436.20817-2-anprice@redhat.com>

Andrew Price <anprice@redhat.com> 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"); 

(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.

> +	/* 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).

> +			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.  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.

Can you use vfs_get_block_super()?  Would it be of use to export
test_bdev_super_fc() and set_bdev_super_fc()?

David

  parent reply	other threads:[~2019-03-19 17:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19 16:04 [PATCH v2 0/2] gfs2: Switch to the new mount API Andrew Price
2019-03-19 16:04 ` [PATCH v2 1/2] gfs2: Convert gfs2 to fs_context Andrew Price
2019-03-19 16:04 ` [PATCH v2 2/2] gfs2: Convert gfs2meta " Andrew Price
2019-03-19 17:05 ` David Howells [this message]
2019-03-19 17:53   ` [PATCH v2 1/2] gfs2: Convert gfs2 " Andrew Price
2019-03-21 12:57     ` Andrew Price
2019-03-21 17:08     ` David Howells
2019-03-21 17:26       ` [PATCH] vfs: Allow selection of fs root independent of sb Andrew Price
2019-03-21 18:36         ` Matthew Wilcox
2019-03-21 17:59       ` David Howells

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=11353.1553015136@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=anprice@redhat.com \
    --cc=cluster-devel@redhat.com \
    --cc=linux-fsdevel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).