Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2205334rdh; Tue, 26 Sep 2023 16:27:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1WIDn5nePfzpYWCme3xtJx4u2Sq7/vo68pa1Kphi7jWzC/2rUUjNcxFAOa7p00q5/AB9h X-Received: by 2002:a17:90a:710b:b0:267:909f:3719 with SMTP id h11-20020a17090a710b00b00267909f3719mr184590pjk.19.1695770833001; Tue, 26 Sep 2023 16:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695770832; cv=none; d=google.com; s=arc-20160816; b=HNNW4QJveeGFruNsfWrIFF/0wERdf1pr4eu4bnsesr368m+WSV9nRc0t8hWe4HVvKN fn1lFwgl1gquKjh94hIo10AYjVJfh67AEKDhoJJuj/7kNQ+gttvyC3Lp1og++pPEugSr 6utSPux6GehRs4ZYUNQc3Yfu9XMNVB416Skqjgny047r3zxnGhwdj6l3vJ8zOyP42bzi Z8bCesfTItO9YOKopytym3ShHzA/xC5if1LL4BrsIm+aPDrXzh0ogra3XgC01LlsUdLb rHbR7+HNzkaK1UyKE1G8STePgaKz4N/VqVjtQydlP+KmHGrd9Z5TH6G8cxN4o6NJxgWE d4MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=4a0+/j3wqqmi1vR/kPX5Kqapr51Hnx898rdCOogEsLU=; fh=vbHRV9atmrVZ047tTiFnE0wvdyHjCfjuUOk/naApV54=; b=HK+sc4ty+KBzez+adUNE8tyb0f/O0ZCSUst/Z4FmGtkIXeMTiR9TtSrg47YGHzTxcp MVrj9DYlE5GBAowh+T7DiPRBraTt6MTUtJXPtpVQDiofPk3hQ9TrRh+xwMjV8vwQRVPb viKBFX1FjeE5puUypSEzzuymR8iPH1P1Dck+MEvnG8KnBxyfGRJv2Cv9S0V71kRYuxPm f8Cb3ew7uht2cnWx4KBjw6xT+iMaf+cqzrUvPr9RcBNo2nX052LDEpog85ugwudfvmYT VbZ2Uc4yM4UYUnqXITVCkJnR/2X5eRY4NpMFj03T7LCULYyQI7WvypVUS9+RLB5kAmli nD+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BEzsnhIA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id mi2-20020a17090b4b4200b00277636a9e5csi6335743pjb.96.2023.09.26.16.27.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 16:27:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BEzsnhIA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 7A80A825B4A7; Tue, 26 Sep 2023 06:50:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234884AbjIZNuC (ORCPT + 99 others); Tue, 26 Sep 2023 09:50:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234878AbjIZNt6 (ORCPT ); Tue, 26 Sep 2023 09:49:58 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 936C110C for ; Tue, 26 Sep 2023 06:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695736141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4a0+/j3wqqmi1vR/kPX5Kqapr51Hnx898rdCOogEsLU=; b=BEzsnhIAJFuHg5/vBw0yXAxQ53zKFrFp2dYvamwG/o/o/YDUfcaYA1HdE2WEVd0C4ylCUH jRhVDyFVQ6ZFpn+npqH65vWdtGs3vdegAZ5qxbJZc1nxxYihEVKaLlnUAeMbapFPDxBN8k IFrkviWQtRzHaln6mIMvpplTC4DeM9A= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-75-td5N-bvqNoevhu9VjagDWQ-1; Tue, 26 Sep 2023 09:48:57 -0400 X-MC-Unique: td5N-bvqNoevhu9VjagDWQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A2B45101A529; Tue, 26 Sep 2023 13:48:56 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.53]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3291A140273D; Tue, 26 Sep 2023 13:48:53 +0000 (UTC) From: Florian Weimer To: Miklos Szeredi Cc: Christian Brauner , 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 References: <20230913152238.905247-1-mszeredi@redhat.com> <20230913152238.905247-3-mszeredi@redhat.com> <20230914-salzig-manifest-f6c3adb1b7b4@brauner> <20230914-lockmittel-verknallen-d1a18d76ba44@brauner> <20230918-grafik-zutreffen-995b321017ae@brauner> Date: Tue, 26 Sep 2023 15:48:51 +0200 In-Reply-To: (Miklos Szeredi's message of "Mon, 18 Sep 2023 16:14:02 +0200") Message-ID: <871qeloxj0.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Tue, 26 Sep 2023 06:50:01 -0700 (PDT) * Miklos Szeredi: > On Mon, Sep 18, 2023 at 3:51=E2=80=AFPM Christian Brauner wrote: > >> I really would prefer a properly typed struct and that's what everyone >> was happy with in the session as well. So I would not like to change the >> main parameters. > > I completely agree. Just would like to understand this point: > > struct statmnt *statmnt(u64 mntid, u64 mask, unsigned int flags); > > What's not properly typed about this interface? > > I guess the answer is that it's not a syscall interface, which will > have an added [void *buf, size_t bufsize], while the buffer sizing is > done by a simple libc wrapper. > > Do you think that's a problem? If so, why? Try-and-resize interfaces can be quite bad for data obtained from the network. If the first call provides the minimum buffer size (like getgroups, but unlike readlink or the glibc *_r interfaces for NSS), this could at least allow us to avoid allocating too much. In userspace, we cannot reduce the size of the heap allocation without knowing where the pointers are and what they mean. I also don't quite understand the dislike of variable-sized records. Don't getdents, inotify, Netlink all use them? And I think at least for Netlink, more stuff is added all the time? Thanks, Florian