From: Christoph Hellwig <hch@lst.de>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>,
Chuck Lever <chuck.lever@oracle.com>,
Jeff Layton <jlayton@kernel.org>, Christoph Hellwig <hch@lst.de>,
Neil Brown <neilb@suse.de>, Jan Kara <jack@suse.cz>,
linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org
Subject: Re: [PATCH] nfsd: do not allow exporting of special kernel filesystems
Date: Wed, 21 Jan 2026 11:12:34 +0100 [thread overview]
Message-ID: <20260121101234.GA22918@lst.de> (raw)
In-Reply-To: <20260121085028.558164-1-amir73il@gmail.com>
On Wed, Jan 21, 2026 at 09:50:27AM +0100, Amir Goldstein wrote:
> pidfs and nsfs recently gained support for encode/decode of file handles
> via name_to_handle_at(2)/opan_by_handle_at(2).
>
> These special kernel filesystems have custom ->open() and ->permission()
> export methods, which nfsd does not respect and it was never meant to be
> used for exporting those filesystems by nfsd.
>
> Therefore, do not allow nfsd to export filesystems with custom ->open()
> or ->permission() methods.
Yeah, this was added in and not used in the existing export_ops users.
> + /*
> + * The requirements for a filesystem to be exportable:
> + * 1. The filehandle must identify a filesystem by number
> + * 2. The filehandle must uniquely identify an inode
> + * 3. The filesystem must not have custom filehandle open/perm methods
> + * 4. The requested file must not reside on an idmapped mount
> */
Please spell out here why ->open and ->permission are not allowed.
Listing what the code does is generally not that useful, while why
it does that provides value.
While looking this I have to say the API documentation for these
methods in exportfs.h is unfortunately completely useless as well.
It doesn't mention the limitation that it's only used by the
non-exportfs code, and also doesn't mention why a file system
would implement or have to implement them :( The commit messages
adding them are just as bad as well.
next prev parent reply other threads:[~2026-01-21 10:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 8:50 [PATCH] nfsd: do not allow exporting of special kernel filesystems Amir Goldstein
2026-01-21 9:25 ` Amir Goldstein
2026-01-21 9:50 ` NeilBrown
2026-01-21 10:24 ` Amir Goldstein
2026-01-21 14:50 ` Christoph Hellwig
2026-01-21 10:12 ` Christoph Hellwig [this message]
2026-01-21 10:35 ` Amir Goldstein
2026-01-21 14:53 ` Christoph Hellwig
2026-01-21 11:45 ` Jeff Layton
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=20260121101234.GA22918@lst.de \
--to=hch@lst.de \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=jack@suse.cz \
--cc=jlayton@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
/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