Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4453731imw; Tue, 19 Jul 2022 06:57:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tVsW1gRs1Fj4ijzHnqOVbgSxxtlNkrzjyf3LPl/Ijn8p66XzRkLNICTvUk0ozBrbPIO0vd X-Received: by 2002:a17:907:8687:b0:72e:e524:1803 with SMTP id qa7-20020a170907868700b0072ee5241803mr22965690ejc.411.1658239068752; Tue, 19 Jul 2022 06:57:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658239068; cv=none; d=google.com; s=arc-20160816; b=ZOivRjO/uZvOon7Vdw5No+CP5ZgTFBRgiT/OzWE+cTy0cJgVMHP0VXE+ih0V9OUQIi 9UeiCuRlR7z14qwlx6Ei0GShViYIRwbDE9lZ7OBOK0WEzWWxWbtI7oRnQwiN7FaIse4E p2B5Dkhf1vgY+11lp/RzYUe4bMJ4P63E4Bv86DPgjJFgy+3J4xKhvofQ381nkhadoDxe ZXC1QJEeiY4iu4MQM4u1g4K/Qkk+EgO6UjQNkIrGdLMynOXKDtIgbUPXW3XhdxapMYVp 1zmZav9kuOfC14694wTd7JQ0C6as3eeyTGTcjg5eVVdjBu2qwMJziZiBC2LMLh0KL1MR sDAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GYUat2R3yPsKAwD3MsZ21EEQ34Qz8Au2by9MurkA7ho=; b=wZ97bkkNtj3cVZ9rxjSXWYW82AsdmKA4O2uX2ul4nkxT/oYFa++PrZjiIYxtdRDizz pG2WHGBDfPAEn6S1lVws1tFiSQy5/0Zk5vG0HS5y/gBqlrRHs9ejc9flx2yaJ5GdP/EW DSRI6KNZRUop+ODgGVqJJG+ajZoIcGZJWtZJqT+YbU2Bvbfh2xHHXKE11qZwjeigFn7o HPXbUBGlzNhydaAebpRz8xFjcg/8uGsZStz6i2vv4RU+YrYryUAb3G6gLKC/a2e3wIMF b5zmB6OasYmVa2UV4lHVhKpZh5uYjQgQicLFKSAg25Vx6ET2wkH4lW2XKLaP+ybTYWWH KIpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mit.edu header.s=outgoing header.b=PLRkMVjq; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd17-20020a1709069b9100b0072a6b4767d0si14018806ejc.793.2022.07.19.06.57.23; Tue, 19 Jul 2022 06:57:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mit.edu header.s=outgoing header.b=PLRkMVjq; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238402AbiGSNg0 (ORCPT + 99 others); Tue, 19 Jul 2022 09:36:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238385AbiGSNgP (ORCPT ); Tue, 19 Jul 2022 09:36:15 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D4A659258; Tue, 19 Jul 2022 05:51:05 -0700 (PDT) Received: from cwcc.thunk.org (pool-173-48-118-63.bstnma.fios.verizon.net [173.48.118.63]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 26JCoxkA026760 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Jul 2022 08:50:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1658235060; bh=GYUat2R3yPsKAwD3MsZ21EEQ34Qz8Au2by9MurkA7ho=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=PLRkMVjqwkoWFTm133zDvtIVBqWVOYV4UaWYxvQgoXaGBoWsLmDOQigtbCdr+EoqP Uxq2XnUIUtOPnlvojjR+V5zEiX2KxvtHXqNUy8m229654By36Awiim4FPH5Q+N5ono nsJRfuH/7SulBrAfuDi47NjEt8Pc5Ahf5tlWHQvfRSkh3WUqntVabgrNN5PEx4OqSw AbRupZMEgbV8cFRJcu2knodKUTLugoOJO/5jeQGO0mo8Z63sEonMB3kteAxDenks7H 9zUuh4vId9ylQ4Cb76vHKAb+Ool2g7njEUG/kUouCcx1aOcnVRvXzf9IFkaTOUoydu /VxsaisIclSQw== Received: by cwcc.thunk.org (Postfix, from userid 15806) id C2DDC15C00E4; Tue, 19 Jul 2022 08:50:58 -0400 (EDT) Date: Tue, 19 Jul 2022 08:50:58 -0400 From: "Theodore Ts'o" To: Arnd Bergmann Cc: Jeremy Bongio , Ext4 Developers List , Linux API , Linux FS-devel Mailing List Subject: Re: [PATCH v3] Add ioctls to get/set the ext4 superblock uuid. Message-ID: References: <20220719065551.154132-1-bongiojp@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Jul 19, 2022 at 09:30:23AM +0200, Arnd Bergmann wrote: > On Tue, Jul 19, 2022 at 8:55 AM Jeremy Bongio wrote: > > This pair of ioctls may be implemented in more filesystems in the future, > > namely XFS. > > > > > +++ b/fs/ext4/ext4.h > > @@ -724,6 +724,8 @@ enum { > > +#define EXT4_IOC_GETFSUUID _IOR('f', 44, struct fsuuid) > > +#define EXT4_IOC_SETFSUUID _IOW('f', 44, struct fsuuid) > > The implementation looks good to me, but maybe it should be defined in > the UAPI headers in a filesystem-independent way? Having it in a private > header means it will not be available to portable user programs, and will > be hidden from tools like strace that parse the uapi headers to find > ioctl definitions. The plan is that when another file system implements it, we'll promote this to be a include/uapi/linux/fs.h. For e2fsprogs, we've always hard-coded the ioctl definitions as a default, because we don't want to be tied to having the correct version for the kernel header files --- I consider it important that there aren't variences in what kind of functionality you get if you build e2fsprogs on RHEL vs Fedora vs Debian Stable. And at least initially, the primary consumer of the ioctl will be tune2fs. As to why we define things first in the file system header, part of this is due to some interesting dynamics around bike-shedding. It is perceived that there are times when the bike-shed brigade comes up in full force, giving conflicting demands, and generally preventing forward progress, and so one of the reasons why file system developers often want to define things first a file-system dependent way is as a safety value so that we can blow past "unreasonable" demands. This recently came up in a LSF/MM discussion where Kent Overstreet proposed a new "ioctl" mechanism which promised that all ioctls would go through the full strict syscall ABI review and that there be no way to bypass it --- and in his view, this was considered a feature, and not a bug. Interestingly, after this LSF/MM discussion, a certain major file system maintainer (not myself) stated in a hallway coversation that due to unreasonable bike-sheeding, he was planning on bypassing the whole review process and just defining in an fs-dependent ioctl in an fs-specific header file because he was so f***** frustrated by the process. Of course, for every unreasonable bike-shedding, there are cases like the dedup ioctl which has recently observed that the interface was terrible, and it *should* have gone through more careful review before making it be a user-visible interface that multiple file systems now have to deal with. At this point, my personal "Via Media" approach to this is to send the patches for full review to all of the usual places, so we *can* get the benefits of interfave review. However, if things go pear-shaped, since the ioctl's are defined as fs-specific I can pull the "I'm the XXX fs maintainer" card, and just include it in my next pull request to Linus. If ioctl has a reasonable interface, then other file system maintainers can choose to adopt it, at which point we promote it to be an fs-independent ioctl. Or maybe they'll define their own fs-depedent ioctl, and we iterate in that way, using a market-forces dynamics ala how we have independent Linux distributions which compete with one another to provide a better use experience, as opposed to a single One True Userspace under the authority of the NetBSD or FreeBSD core team. It's not a perfect mechanism, but given that we don't have something like an Architectural Review Board with appeals up to some management chain if said ARB becomes obstructive (which is how things might work in a corporate environment), it's the best approach I've been able to come up with. - Ted P.S. BTW, this isn't a problem which is unique to system calls, but new file system icotls seem to be defined much more often than system calls. Whether that's because we naturally need many more of these interfaces, many of which are used by primarily by the XXX-fsprogs utilities, or because it's an escape hatch when the system call review process is perceived, correctly, or incorrectly, in too heavy-weight and prone to bike-shedding, is certainly a debatable point. But perhaps this is more of a Maintainer's Summit topic, although I don't think there really is a good solution other than "sometimes, someone in a position of power, whether it's Linus or a fs maintainer, has to be able to use an escape hatch when the process goes sideways.