From: NeilBrown <neilb@suse.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Andreas Dilger <adilger@dilger.ca>,
"J. Bruce Fields" <bfields@redhat.com>,
linux-nfs <linux-nfs@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
abe@purdue.edu, lsof-l@lists.purdue.edu,
util-linux@vger.kernel.org, Jeff Layton <jlayton@redhat.com>,
James Simmons <uja.ornl@gmail.com>
Subject: Re: [PATCH 00/10] exposing knfsd opens to userspace
Date: Mon, 29 Apr 2019 08:57:37 +1000 [thread overview]
Message-ID: <874l6h68m6.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <20190427190038.GB9568@fieldses.org>
[-- Attachment #1: Type: text/plain, Size: 2422 bytes --]
On Sat, Apr 27 2019, J. Bruce Fields wrote:
> On Sat, Apr 27, 2019 at 09:55:23AM +1000, NeilBrown wrote:
>> On Fri, Apr 26 2019, J. Bruce Fields wrote:
>> > But it's true that from the start nfsd didn't really fit the model
>> > of a single (possibly writeable) attribute per file.
>>
>> Depends on what you mean by that. Original files where write-only and
>> where slightly complex attributes.
>
> Yes I thought it was just those too, but then I looked at the original
> commit it also included at least the "exports" file.
Maybe it depends on how one chooses to interpret history - never an
exact science.
The "exports" file pre-existed the nfsd filesystem - it was (and still
is) a file in procfs: /proc/fs/nfs/exports. So the nfsd filesystem was
not created to provide that file. It was created to replace a
systemcall.
As I said, it subsequently had a variety of things added to it. exports
was just the first of these. At least, that is how I choose to see it.
>
>> Writing performed an action, like
>> adding an entry to the export table (first you add a client, then add a
>> client+filesystem to export it).
>>
>> This idea for a file performing an action, rather than presenting an
>> attribute, is much the same as the "bind" and "unbind" files you can
>> find in sysfs.
>>
>> (see also https://lwn.net/Articles/378884/ for examples of sysfs files
>> that are not one-attribute-per-file)
>
> I'll give that a re-read, thanks.
>
> I did spend maybe a few minutes looking into basing nfsd code on kernfs
> and didn't think it was worth it. I could take a more serious look.
I think that in your use-case it make lots of sense to have a structured
file for the "opens" (similar to /proc/locks and /proc/mounts).
The "info" could reasonably be several attribute files (clientid,
address, name, minor_version), but I don't think it benefits anyone for
'opens' to be a directory full of directories each with a file for each
of the fields.
So using kernfs would mean pushing for allowing structured files in
kernfs. I'd be happy to support that, but I think you would need to go
into it convinced that you really wanted to persist.
I think using kernfs is mostly about embedding a kobject in everything,
then setting an appropriate ktype with appropriate attributes. Not
particularly complex, but certainly a bit of work.
Thanks,
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2019-04-28 22:57 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-25 14:04 [PATCH 00/10] exposing knfsd opens to userspace J. Bruce Fields
2019-04-25 14:04 ` [PATCH 01/10] nfsd: persist nfsd filesystem across mounts J. Bruce Fields
2019-04-25 14:04 ` [PATCH 02/10] nfsd: rename cl_refcount J. Bruce Fields
2019-04-25 14:04 ` [PATCH 03/10] nfsd4: use reference count to free client J. Bruce Fields
2019-04-25 14:04 ` [PATCH 04/10] nfsd: add nfsd/clients directory J. Bruce Fields
2019-04-25 14:04 ` [PATCH 05/10] nfsd: make client/ directory names small ints J. Bruce Fields
2019-04-25 14:04 ` [PATCH 06/10] rpc: replace rpc_filelist by tree_descr J. Bruce Fields
2019-04-25 14:04 ` [PATCH 07/10] nfsd4: add a client info file J. Bruce Fields
2019-04-25 14:04 ` [PATCH 08/10] nfsd4: add file to display list of client's opens J. Bruce Fields
2019-04-25 18:04 ` Jeff Layton
2019-04-25 20:14 ` J. Bruce Fields
2019-04-25 21:14 ` Andreas Dilger
2019-04-26 1:18 ` J. Bruce Fields
2019-05-16 0:40 ` J. Bruce Fields
2019-04-25 14:04 ` [PATCH 09/10] nfsd: expose some more information about NFSv4 opens J. Bruce Fields
2019-05-02 15:28 ` Benjamin Coddington
2019-05-02 15:58 ` Andrew W Elble
2019-05-07 1:02 ` J. Bruce Fields
2019-04-25 14:04 ` [PATCH 10/10] nfsd: add more information to client info file J. Bruce Fields
2019-04-25 17:02 ` [PATCH 00/10] exposing knfsd opens to userspace Jeff Layton
2019-04-25 20:01 ` J. Bruce Fields
2019-04-25 18:17 ` Jeff Layton
2019-04-25 21:08 ` Andreas Dilger
2019-04-25 23:20 ` NeilBrown
2019-04-26 11:00 ` Andreas Dilger
2019-04-26 12:56 ` J. Bruce Fields
2019-04-26 23:55 ` NeilBrown
2019-04-27 19:00 ` J. Bruce Fields
2019-04-28 22:57 ` NeilBrown [this message]
2019-04-27 0:03 ` NeilBrown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874l6h68m6.fsf@notabene.neil.brown.name \
--to=neilb@suse.com \
--cc=abe@purdue.edu \
--cc=adilger@dilger.ca \
--cc=bfields@fieldses.org \
--cc=bfields@redhat.com \
--cc=jlayton@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=lsof-l@lists.purdue.edu \
--cc=uja.ornl@gmail.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).