From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92272C43381 for ; Tue, 19 Mar 2019 17:05:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 62D1720850 for ; Tue, 19 Mar 2019 17:05:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726926AbfCSRFl convert rfc822-to-8bit (ORCPT ); Tue, 19 Mar 2019 13:05:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53448 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726579AbfCSRFl (ORCPT ); Tue, 19 Mar 2019 13:05:41 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6B24D307D972 for ; Tue, 19 Mar 2019 17:05:41 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-47.rdu2.redhat.com [10.10.120.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3DF155D77B; Tue, 19 Mar 2019 17:05:37 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20190319160436.20817-2-anprice@redhat.com> References: <20190319160436.20817-2-anprice@redhat.com> <20190319160436.20817-1-anprice@redhat.com> To: Andrew Price 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 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11352.1553015136.1@warthog.procyon.org.uk> Content-Transfer-Encoding: 8BIT Date: Tue, 19 Mar 2019 17:05:36 +0000 Message-ID: <11353.1553015136@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 19 Mar 2019 17:05:41 +0000 (UTC) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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"); (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