Allow NFS filesystems to be reexported via knfsd
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest38 patches 13 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/38 | nfsd: add new io class tracepointfs/ fs/ fs/ | +79 | 0 replies | |
| 2/38 | fs: have flush_delayed_fput flush the workqueue jobfs/ | +3 | 0 replies | |
| 3/38 | fs: add a kerneldoc header to fputfs/ | +20 | 0 replies | |
| 4/38 | fs: rename "delayed_fput" infrastructure to "fput_global"fs/ include/ init/ | +22 | 0 replies | |
| 5/38 | fs: add fput_globalfs/ include/ | +34 | 0 replies | |
| 6/38 | fsnotify: fix a sparse warningfs/ | +1 | 0 replies | |
| 7/38 | fsnotify: export several symbolsfs/ fs/ fs/ | +7 | 0 replies | |
| 8/38 | fsnotify: destroy marks with call_srcu instead of dedicated threadfs/ include/ | +20 | 0 replies | |
| 9/38 | fsnotify: add a srcu barrier for fsnotifyfs/ include/ | +9 | 0 replies | |
| 10/38 | locks: create a new notifier chain for lease attemptsfs/ include/ | +38 | 0 replies | |
| 11/38 | sunrpc: add a new cache_detail operation for when a cache is flushedinclude/ net/ | +4 | 0 replies | |
| 12/38 | nfsd: add a new struct file caching facility to nfsdfs/ fs/ fs/ +6 more | +879 | 0 replies | |
| 13/38 | nfsd: keep some rudimentary stats on nfsd_file cachefs/ fs/ fs/ | +62 | 0 replies | |
| 14/38 | nfsd: allow filecache open to skip fh_verify checkfs/ fs/ fs/ | +46 | 0 replies | |
| 15/38 | nfsd: hook up nfsd_write to the new nfsd_file cachefs/ fs/ fs/ +1 more | +13 | 0 replies | |
| 16/38 | nfsd: hook up nfsd_read to the nfsd_file cachefs/ | +10 | 0 replies | |
| 17/38 | nfsd: hook nfsd_commit up to the nfsd_file cachefs/ | +7 | 0 replies | |
| 18/38 | nfsd: convert nfs4_file->fi_fds array to use nfsd_filesfs/ fs/ | +13 | 0 replies | |
| 19/38 | nfsd: have nfsd_test_lock use the nfsd_file cachefs/ | +4 | 0 replies | |
| 20/38 | nfsd: convert fi_deleg_file and ls_file fields to nfsd_filefs/ fs/ fs/ | +76 | 0 replies | |
| 21/38 | nfsd: hook up nfs4_preprocess_stateid_op to the nfsd_file cachefs/ fs/ fs/ +2 more | +39 | 0 replies | |
| 22/38 | nfsd: rip out the raparms cachefs/ fs/ fs/ | +1 | 0 replies | |
| 23/38 | nfsd: add a new EXPORT_OP_NOWCC flag to struct export_operationsDocumentation/ fs/ fs/ +2 more | +51 | 0 replies | |
| 24/38 | nfsd: allow lockd to be forcibly disabledfs/ | +11 | 0 replies | |
| 25/38 | nfsd: add errno mapping for EREMOTEIOfs/ | +1 | 0 replies | |
| 26/38 | nfsd: return EREMOTE if we find an S_AUTOMOUNT inodefs/ fs/ | +8 | 0 replies | |
| 27/38 | nfsd: allow filesystems to opt out of subtree checkingDocumentation/ fs/ include/ | +20 | 1 reply | |
| 28/38 | nfsd: close cached files prior to a REMOVE or RENAME that would replace targetDocumentation/ fs/ fs/ +3 more | +103 | 0 replies | |
| 29/38 | nfsd: retry once in nfsd_open on an -EOPENSTALE returnfs/ fs/ | +11 | 0 replies | |
| 30/38 | nfsd: close cached file when underlying file systems says no such filefs/ | +83 | 0 replies | |
| 31/38 | nfs: replace d_add with d_splice_alias in atomic_openfs/ | +1 | 4 replies | |
| 32/38 | nfs: add encode_fh export opfs/ fs/ | +47 | 0 replies | |
| 33/38 | nfs: add fh_to_dentry export opfs/ | +49 | 0 replies | |
| 34/38 | nfs: nfs_fh_to_dentry() make use of inode cachefs/ fs/ include/ +1 more | +72 | 0 replies | |
| 35/38 | nfs4: add NFSv4 LOOKUPP handlersfs/ fs/ fs/ +2 more | +168 | 0 replies | |
| 36/38 | nfs: add a get_parent export operation for NFSfs/ | +43 | 0 replies | |
| 37/38 | nfs: set export opsfs/ fs/ | +6 | 0 replies | |
| 38/38 | nfs: add a Kconfig option for NFS reexporting and documentationDocumentation/ fs/ | +106 | 8 replies |
Reviews trailers per patch
1 of 38 patches has a Reviewed-by or Acked-by.
| Patch | Jan Kara |
|---|---|
| 1/38 | |
| 2/38 | |
| 3/38 | |
| 4/38 | |
| 5/38 | |
| 6/38 | |
| 7/38 | |
| 8/38 | R-b |
| 9/38 | |
| 10/38 | |
| 11/38 | |
| 12/38 | |
| 13/38 | |
| 14/38 | |
| 15/38 | |
| 16/38 | |
| 17/38 | |
| 18/38 | |
| 19/38 | |
| 20/38 | |
| 21/38 | |
| 22/38 | |
| 23/38 | |
| 24/38 | |
| 25/38 | |
| 26/38 | |
| 27/38 | |
| 28/38 | |
| 29/38 | |
| 30/38 | |
| 31/38 | |
| 32/38 | |
| 33/38 | |
| 34/38 | |
| 35/38 | |
| 36/38 | |
| 37/38 | |
| 38/38 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v1 00/38] Allow NFS filesystems to be reexported via knfsd
This patchset adds export operations to nfs, so that it can be reexported via knfsd. You're probably thinking to yourself: "Why on earth would I want to do such a thing?". I'm glad you asked...
The primary use case here is to allow clients that do not support newer NFS versions (and in particular, those that don't support pnfs) to access servers that do not support older NFS versions. Our main interest is in allowing NFSv4.2 (particularly with pnfs) to be reexported via NFSv3.
The traditional way of allowing legacy client access is to simply allow the MDS to support older NFS versions, but handling in-band I/O can be a fair bit of work for the MDS. By reexporting we can offload that work onto a different host and allow the MDS to focus on layout handling.
I can also envision this being useful with the pnfs block protocol to allow access by clients that don't have access to the SAN on which the block devices live. An admin could designate a separate host on the SAN as a "portal" and have the external clients mount that host.
The main part of the set is focused on adding an open file cache to nfsd. NFSv4 has a pretty slow open codepath, so allowing the server to cache the open files takes the performance from abyssimal to acceptable.
I've posted that portion of the patchset before so it may look familiar to some folks. Implementing that involves some changes to a few other vfs-layer subsystems:
fsnotify's SRCU cleanup needs to be converted to use call_srcu, and we have to add a function to call srcu_barrier on it. This is so we can be sure that all the fsnotify marks are gone before we tear down their slabcache. It also needs some symbols exported so that nfsd can use it.
The fput machinery needs a function that allows non-kthreads to queue the final __fput to the list that kthreads ordinarily use. This is mainly to allow us to completely close files in advance of a setlease attempt.
After that swath of patches, there is a pile of NFS client patches that add the export operations that are necessary to allow it to be reexported. Most of these are under the aegis of a new CONFIG_NFS_REEXPORT option (that defaults to 'n'). There are a number of caveats to reexporting that I've tried to document as well in a new Documenation/ file.
I know it's ambitious for such a large set, but I'd like to see this merged in v4.5 if possible. If not, then it would be helpful to be able to make some progress toward that by getting the fput and fsnotify changes merged for that release.
Jeff Layton (32):
nfsd: add new io class tracepoint
fs: have flush_delayed_fput flush the workqueue job
fs: add a kerneldoc header to fput
fs: rename "delayed_fput" infrastructure to "fput_global"
fs: add fput_global
fsnotify: fix a sparse warning
fsnotify: export several symbols
fsnotify: destroy marks with call_srcu instead of dedicated thread
fsnotify: add a srcu barrier for fsnotify
locks: create a new notifier chain for lease attempts
sunrpc: add a new cache_detail operation for when a cache is flushed
nfsd: add a new struct file caching facility to nfsd
nfsd: keep some rudimentary stats on nfsd_file cache
nfsd: allow filecache open to skip fh_verify check
nfsd: hook up nfsd_write to the new nfsd_file cache
nfsd: hook up nfsd_read to the nfsd_file cache
nfsd: hook nfsd_commit up to the nfsd_file cache
nfsd: convert nfs4_file->fi_fds array to use nfsd_files
nfsd: have nfsd_test_lock use the nfsd_file cache
nfsd: convert fi_deleg_file and ls_file fields to nfsd_file
nfsd: hook up nfs4_preprocess_stateid_op to the nfsd_file cache
nfsd: rip out the raparms cache
nfsd: add a new EXPORT_OP_NOWCC flag to struct export_operations
nfsd: allow lockd to be forcibly disabled
nfsd: add errno mapping for EREMOTEIO
nfsd: return EREMOTE if we find an S_AUTOMOUNT inode
nfsd: allow filesystems to opt out of subtree checking
nfsd: close cached files prior to a REMOVE or RENAME that would
replace target
nfsd: retry once in nfsd_open on an -EOPENSTALE return
nfs4: add NFSv4 LOOKUPP handlers
nfs: add a get_parent export operation for NFS
nfs: add a Kconfig option for NFS reexporting and documentation
Peng Tao (6):
nfsd: close cached file when underlying file systems says no such file
nfs: replace d_add with d_splice_alias in atomic_open
nfs: add encode_fh export op
nfs: add fh_to_dentry export op
nfs: nfs_fh_to_dentry() make use of inode cache
nfs: set export ops
Documentation/filesystems/nfs/Exporting | 52 ++ Documentation/filesystems/nfs/reexport.txt | 95 ++++ fs/file_table.c | 94 +++- fs/locks.c | 37 ++ fs/nfs/Kconfig | 11 + fs/nfs/Makefile | 1 + fs/nfs/dir.c | 2 +- fs/nfs/export.c | 169 +++++++ fs/nfs/inode.c | 22 + fs/nfs/internal.h | 2 + fs/nfs/nfs4proc.c | 49 ++ fs/nfs/nfs4trace.h | 29 ++ fs/nfs/nfs4xdr.c | 73 +++ fs/nfs/super.c | 4 + fs/nfsd/Kconfig | 2 + fs/nfsd/Makefile | 3 +- fs/nfsd/export.c | 20 + fs/nfsd/filecache.c | 748 +++++++++++++++++++++++++++++ fs/nfsd/filecache.h | 45 ++ fs/nfsd/nfs3proc.c | 2 +- fs/nfsd/nfs3xdr.c | 7 +- fs/nfsd/nfs4layouts.c | 12 +- fs/nfsd/nfs4proc.c | 32 +- fs/nfsd/nfs4state.c | 174 +++---- fs/nfsd/nfs4xdr.c | 16 +- fs/nfsd/nfsctl.c | 10 + fs/nfsd/nfsfh.c | 14 + fs/nfsd/nfsfh.h | 28 +- fs/nfsd/nfsproc.c | 4 +- fs/nfsd/nfssvc.c | 27 +- fs/nfsd/state.h | 10 +- fs/nfsd/trace.h | 181 +++++++ fs/nfsd/vfs.c | 423 ++++++++-------- fs/nfsd/vfs.h | 11 +- fs/nfsd/xdr4.h | 15 +- fs/notify/fdinfo.c | 2 +- fs/notify/group.c | 2 + fs/notify/inode_mark.c | 1 + fs/notify/mark.c | 77 +-- include/linux/exportfs.h | 12 + include/linux/file.h | 3 +- include/linux/fs.h | 1 + include/linux/fsnotify_backend.h | 12 +- include/linux/nfs4.h | 1 + include/linux/nfs_fs.h | 1 + include/linux/nfs_xdr.h | 17 +- include/linux/sunrpc/cache.h | 1 + init/main.c | 2 +- net/sunrpc/cache.c | 3 + 49 files changed, 2105 insertions(+), 454 deletions(-) create mode 100644 Documentation/filesystems/nfs/reexport.txt create mode 100644 fs/nfs/export.c create mode 100644 fs/nfsd/filecache.c create mode 100644 fs/nfsd/filecache.h
Signature · 1 line
2.4.3