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=-0.9 required=3.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=no 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 C8DB4C11D04 for ; Thu, 20 Feb 2020 12:59:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9CF7624654 for ; Thu, 20 Feb 2020 12:59:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="awxpTPwW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727989AbgBTM7C (ORCPT ); Thu, 20 Feb 2020 07:59:02 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:54573 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726959AbgBTM7B (ORCPT ); Thu, 20 Feb 2020 07:59:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582203540; 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: in-reply-to:in-reply-to:references:references; bh=lgoZ/r5nCvlwSEe4sHdp4x/cyogCcgRFAVbQihojpxY=; b=awxpTPwWKLB3Y37/DSIHdCjT36P9RtN3UsvMy5Ov587uD0Zstend/nH10T7Ls/xSEoHCST y0hPkhk6M0DvCVuliJkVmwit+rIDq/2Z+CR7Jw+T3J2FHGwDO6Rbkoe9qM6svNCylIscfp HC/bgQgfxeozLG14IswkjSLFSBbRK0s= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-380-FXF-0yCqM0yQB_kg1T-nig-1; Thu, 20 Feb 2020 07:58:56 -0500 X-MC-Unique: FXF-0yCqM0yQB_kg1T-nig-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3D2FC107ACC4; Thu, 20 Feb 2020 12:58:55 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-122-163.rdu2.redhat.com [10.10.122.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 932855C13C; Thu, 20 Feb 2020 12:58:53 +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: References: <158204549488.3299825.3783690177353088425.stgit@warthog.procyon.org.uk> <158204558110.3299825.5080605285325995873.stgit@warthog.procyon.org.uk> To: Jann Horn Cc: dhowells@redhat.com, Al Viro , raven@themaw.net, Miklos Szeredi , Christian Brauner , Linux API , linux-fsdevel , kernel list Subject: Re: [PATCH 11/19] afs: Support fsinfo() [ver #16] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <628198.1582203532.1@warthog.procyon.org.uk> Date: Thu, 20 Feb 2020 12:58:52 +0000 Message-ID: <628199.1582203532@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jann Horn wrote: > Ewww. So basically, having one static set of .fsinfo_attributes is not > sufficiently flexible for everyone, but instead of allowing the > filesystem to dynamically provide a list of supported attributes, you > just duplicate the super_operations? Seems to me like it'd be cleaner > to add a function pointer to the super_operations that can dynamically > fill out the supported fsinfo attributes. > > It seems to me like the current API is going to be a dead end if you > ever want to have decent passthrough of these things for e.g. FUSE, or > overlayfs, or VirtFS? Ummm... Would it be sufficient to have a function that returns a list of attributes? Or does it need to be able to call to vfs_do_fsinfo() if it supports an attribute? There are two things I want to be able to do: (1) Do the buffer wrangling in the core - which means the core needs to see the type of the attribute. That's fine if, say, afs_fsinfo() can call vfs_do_fsinfo() with the definition for any attribute it wants to handle and, say, return -ENOPKG otherways so that the core can then fall back to its private list. (2) Be able to retrieve the list of attributes and/or query an attribute. Now, I can probably manage this even through the same interface. If, say, seeing FSINFO_ATTR_FSINFO_ATTRIBUTES causes the handler to simply append on the IDs of its own supported attributes (a helper can be provided for that). If it sees FSINFO_ATR_FSINFO_ATTRIBUTE_INFO, it can just look to see if it has the attribute with the ID matching Nth and return that, else ENOPKG - again a helper could be provided. Chaining through overlayfs gets tricky. You end up with multiple contributory filesystems with different properties - and any one of those layers could perhaps be another overlay. Overlayfs would probably needs to integrate the info and derive the lowest common set. David