Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1932548rdh; Tue, 26 Sep 2023 07:42:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFH2xRZWYHYH5MBU2IfLyAQKHXcIMN+SmhgxpsJGnxV94PezKnLLqG1zrtv8yYmu3rYvDS5 X-Received: by 2002:a05:6a00:995:b0:690:c79c:cc9c with SMTP id u21-20020a056a00099500b00690c79ccc9cmr11860185pfg.14.1695739345040; Tue, 26 Sep 2023 07:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695739345; cv=none; d=google.com; s=arc-20160816; b=YpIEsj9aGeTeh9EkMKFjYQqXtck9usPvhULN+t0akNLARIZNspIo5TjzkU2QwAVd49 +HfmvsOHuAFv5q+ZzN7f1rp/XdY6fmWAUQWlohKNddpj0p1/TrrrPozo5BH1KSewFTVH tGoJDgB5lkgm9q5X898q4jhgwYRfgwZQlUZfsMos8vYJcsR5CeWUdPmBZ07sjNYJ6xLF aJdpQ/pv7wcRKP78KcRh6/5FOnsmXbuOzY/ScNuV0ldcG4i7ugyS3cOhu+fijnqNPyzD pvvqenxm2T+MDXjkiYSwyP0Hu+xzsukzhq85LcLdtcHX1JccHI3KWL9JJGQUQx+/M9y8 FsZA== 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=oKaQFvDOAkKLE8GOWv+Wj+fywsRrpcia5puAgC8O3H0=; fh=U7Ek8LPD/wnzmFxkkXP/PoWptPleUUegQd+4DEz8aMU=; b=ZJe3IxzIRJ8/zvYkaZCJeNAhKNz7sJ76XleIvzuDRwYt8ijgThoB9d54RV54xXbNNK rW2QHWpT75C3i88UfIT06YrJqKJSlCi35JRDIKcZnvN7NpP1PWF2hTFUiFm94UlTOOGL I+JPBAk2OcQBNYagAUKe+S97A1ubT0Gz5kXO+XEDGPf9dG8PUQHl6+gO1XNBZboSStcV SCvZIiacUxbubiW6/N+9xSFFVXL81Cerk/pfnrpZx5r8uIf8DitNHMT7yxszB28MKecB WAOkDWJeaD1EE3v6UJfpCbzzRL2JHoFMIEBSPw7XwUTP6mQ/Vy+Mj6zigeY+JEvXnty9 lI4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V0A5Odbo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id ct7-20020a056a000f8700b0068fe2453ab6si12443065pfb.353.2023.09.26.07.42.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 07:42:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V0A5Odbo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 700A180C7AE9; Tue, 26 Sep 2023 07:37:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234436AbjIZOhP (ORCPT + 99 others); Tue, 26 Sep 2023 10:37:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231137AbjIZOhM (ORCPT ); Tue, 26 Sep 2023 10:37:12 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72AC9101; Tue, 26 Sep 2023 07:37:06 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02376C433C8; Tue, 26 Sep 2023 14:37:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695739026; bh=2NvGlKjGPmS59w7M/PVsQ0zOobsxsCNxbWVuC18Xz+Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V0A5OdboYGi/BMVyBFZlepKCiGKAKAHP0O8iO/FE+rDWXdPJoD7t3JkIMi3pQeC9W mgUPJswwYx47wSPqtYNYj6Q/K/Dbg6i72lxgC0WOyyQYGApXCeztrhIv3XTI7wQ2yg 4LNNKreUN5GNfkMlJJGbIS1vd/i5p294BsIReAtMmEn5IvMqBIR2e/MYgCs3ncBXZk NmdgMgHynsRs9x7NI5FEq3iaYllJGm7udNH7Ft81u/6nj8aA6QMG1tUWEhPVXb3w09 lbcD+Y2hNdkxpUdiEmkoXttiwkC1CosYk/f0DKRcER8M6iBqVqqU2i5085rBM8VZuA /6QKrj0bLlmRg== Date: Tue, 26 Sep 2023 16:36:59 +0200 From: Christian Brauner To: Florian Weimer Cc: Miklos Szeredi , Miklos Szeredi , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-man@vger.kernel.org, linux-security-module@vger.kernel.org, Karel Zak , Ian Kent , David Howells , Al Viro , Christian Brauner , Amir Goldstein Subject: Re: [RFC PATCH 2/3] add statmnt(2) syscall Message-ID: <20230926-parolen-gebohrt-bcb01adc1aae@brauner> References: <20230913152238.905247-3-mszeredi@redhat.com> <20230914-salzig-manifest-f6c3adb1b7b4@brauner> <20230914-lockmittel-verknallen-d1a18d76ba44@brauner> <20230918-grafik-zutreffen-995b321017ae@brauner> <871qeloxj0.fsf@oldenburg.str.redhat.com> <87wmwdnhj1.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87wmwdnhj1.fsf@oldenburg.str.redhat.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 26 Sep 2023 07:37:13 -0700 (PDT) > With an opaque, pointer-carrying struct, copying out the data is not > possible in a generic fashion. Only the parts that the application > knows about can be copied out. So I think it's desirable to have a > fairly exact allocation. This could easily be added if we added size parameters like I originally suggested for the variable sized mnt_root and mnt_point records into struct statmount. If the user specified that they want to retrieve the mnt_root and mnt_mountpoint in @mask and the size for the relevant field is zero then we fill in the required size for the relevant field. If they aren't zero we just try to copy in the data in the relevant pointer field. I prefer this interface as it allows for both strategies: * users that don't care about exact allocation size can just pass a guesstimated buffer usually PATH_MAX/2 or sm * users that care about exact allocation size can query the kernel