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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97793C001DF for ; Tue, 1 Aug 2023 15:46:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234988AbjHAPqQ (ORCPT ); Tue, 1 Aug 2023 11:46:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234948AbjHAPqP (ORCPT ); Tue, 1 Aug 2023 11:46:15 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 719DC1AA for ; Tue, 1 Aug 2023 08:46:12 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 765476732D; Tue, 1 Aug 2023 17:46:08 +0200 (CEST) Date: Tue, 1 Aug 2023 17:46:07 +0200 From: Christoph Hellwig To: Christian Brauner Cc: Jan Kara , Christoph Hellwig , Al Viro , David Howells , Aleksa Sarai , Karel Zak , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH RFC 3/3] fs: add FSCONFIG_CMD_CREATE_EXCL Message-ID: <20230801154607.GD12035@lst.de> References: <20230801-vfs-super-exclusive-v1-0-1a587e56c9f3@kernel.org> <20230801-vfs-super-exclusive-v1-3-1a587e56c9f3@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230801-vfs-super-exclusive-v1-3-1a587e56c9f3@kernel.org> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org > + /* require the new mount api */ > + if (exclusive && (fc->ops == &legacy_fs_context_ops)) No need for the inner braces. > + return -EOPNOTSUPP; > + > fc->phase = FS_CONTEXT_CREATING; > + fc->exclusive = exclusive; > > ret = vfs_get_tree(fc); > - if (ret) > + if (ret) { > + fc->exclusive = false; What's the point in clearing the flag on error? > + case FSCONFIG_CMD_CREATE_EXCL: > + fallthrough; > case FSCONFIG_CMD_CREATE: > - ret = vfs_cmd_create(fc); > + ret = vfs_cmd_create(fc, cmd == FSCONFIG_CMD_CREATE_EXCL); > if (ret) > break; > return 0; Nitpick, but I always find it cleaner to do something like: case FSCONFIG_CMD_CREATE_EXCL: ret = vfs_cmd_create(fc, true) break; case FSCONFIG_CMD_CREATE: ret = vfs_cmd_create(fc, false); but that might just be preference.