Overlayfs NFS export support
Status from this message: Pushed to overlayfs-next with one fix (do not warn about falling back
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest17 patches 50 repliesApplied
- v114 patches 7 repliesSuperseded
Patches in v2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/17 | ovl: document NFS exportDocumentation/ | +59 | 6 replies | |
| 2/17 | ovl: encode pure upper file handlesfs/ fs/ fs/ | +106 | 1 reply | |
| 3/17 | ovl: decode pure upper file handlesfs/ fs/ fs/ | +95 | 15 replies | |
| 4/17 | ovl: decode connected upper dir file handlesfs/ | +171 | 17 replies | |
| 5/17 | ovl: encode non-indexed upper file handlesfs/ | +23 | 2 replies | |
| 6/17 | ovl: copy up before encoding dir file handle when ofs->numlower > 1fs/ | +64 | 0 replies | |
| 7/17 | ovl: encode lower file handlesfs/ | +2 | 0 replies | |
| 8/17 | ovl: decode lower non-dir file handlesfs/ fs/ fs/ | +50 | 0 replies | |
| 9/17 | ovl: decode indexed non-dir file handlesfs/ | +47 | 1 reply | |
| 10/17 | ovl: decode lower file handles of unlinked but open filesfs/ fs/ fs/ | +37 | 8 replies | |
| 11/17 | ovl: decode indexed dir file handlesfs/ fs/ fs/ | +15 | 0 replies | |
| 12/17 | ovl: decode pure lower dir file handlesfs/ | +12 | 0 replies | |
| 13/17 | ovl: hash directory inodes for NFS exportfs/ fs/ fs/ | +13 | 0 replies | |
| 14/17 | ovl: lookup connected ancestor of dir in inode cachefs/ fs/ fs/ | +93 | 0 replies | |
| 15/17 | ovl: lookup indexed ancestor of lower dirfs/ fs/ fs/ | +54 | 0 replies | |
| 16/17 | ovl: wire up NFS export supportfs/ fs/ | +10 | 0 replies | |
| 17/17 | nfsd: encode stat->mtime for getattr instead of inode->i_mtimefs/ fs/ | +3 | 0 replies |
Reviews trailers per patch
1 of 17 patches has a Reviewed-by or Acked-by.
| Patch | Jeff Layton |
|---|---|
| 1/17 | |
| 2/17 | |
| 3/17 | |
| 4/17 | |
| 5/17 | |
| 6/17 | |
| 7/17 | |
| 8/17 | |
| 9/17 | |
| 10/17 | |
| 11/17 | |
| 12/17 | |
| 13/17 | |
| 14/17 | |
| 15/17 | |
| 16/17 | |
| 17/17 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 00/17] Overlayfs NFS export support
Miklos,
This is the 2nd revision of series that implements NFS export support. This series is based on a series of prep patches [1] that implement the "verify" feature and were posted earlier to overlayfs list. The complete work is available here [2].
NFS export is enabled for overlayfs mount when the opt-in "verify" feature is enabled, because decoding file handles requires the full index that "verify" feature creates.
The first patch in the series in the Documentation update with a brief overview of the implementation, so reviewers can learn what to expect further along the series.
The 1st revision copied up and indexed all directories on file handle encode. This revision only copies up directories on encode with a multiple lower layers setup. This is done to reduce the complexity of decoding directory file handles and ensure that an encoded dir inode is either upper or the top lower dir.
The current implementation does not support encoding connectable non-dir file handles. When overlayfs is exported with the 'subtree_check' exportfs option, NFS client will get lookup errors and NFS server logs will have warnings like these:
"overlayfs: connectable file handles not supported; \
use 'no_subtree_check' exportfs option"
To unit test overlayfs file handles, I enhanced xfstest open_by_handle test utility to encode/decode directories and check several other cases that were not covered by the original xfstest test. On my xfstests NFS export branch [3], there are two generic tests and two overlayfs specific test on the 'exportfs' group - one for samefs setup and one for non-samefs with two lower layers setup.
To sanity test NFS exported overlayfs, I made a hacky test patch to unionmount-testsuite [4], which runs all the tests on an NFS mount to localhost, while setting up and rotating the overlay mount on the exported local share.
I also ran the NFSTest [5] nfstest_posix group on an exported overlayfs mount, but that test only creates pure upper files in overlay upper dir, so it is not much of a stress to the implementation. This test found one problem with non uptodate overlay inode mtime. The last patch is the series solves this problem in nfsd. It is reviewed by Jeff.
Amir.
[1] https://github.com/amir73il/linux/commits/ovl-index-all
[2] https://github.com/amir73il/linux/commits/ovl-nfs-export-v2
[3] https://github.com/amir73il/xfstests/commits/ovl-nfs-export
[4] https://github.com/amir73il/unionmount-testsuite/commits/ovl-nfs-export
[5] http://wiki.linux-nfs.org/wiki/index.php/NFStest
Amir Goldstein (17):
ovl: document NFS export
ovl: encode pure upper file handles
ovl: decode pure upper file handles
ovl: decode connected upper dir file handles
ovl: encode non-indexed upper file handles
ovl: copy up before encoding dir file handle when ofs->numlower > 1
ovl: encode lower file handles
ovl: decode lower non-dir file handles
ovl: decode indexed non-dir file handles
ovl: decode lower file handles of unlinked but open files
ovl: decode indexed dir file handles
ovl: decode pure lower dir file handles
ovl: hash directory inodes for NFS export
ovl: lookup connected ancestor of dir in inode cache
ovl: lookup indexed ancestor of lower dir
ovl: wire up NFS export support
nfsd: encode stat->mtime for getattr instead of inode->i_mtime
Documentation/filesystems/overlayfs.txt | 59 +++ fs/locks.c | 6 +- fs/nfsd/nfsxdr.c | 1 + fs/overlayfs/Kconfig | 2 + fs/overlayfs/Makefile | 3 +- fs/overlayfs/export.c | 636 ++++++++++++++++++++++++++++++++ fs/overlayfs/inode.c | 29 +- fs/overlayfs/namei.c | 34 +- fs/overlayfs/overlayfs.h | 16 + fs/overlayfs/super.c | 11 + fs/overlayfs/util.c | 4 +- 11 files changed, 778 insertions(+), 23 deletions(-) create mode 100644 fs/overlayfs/export.c
Signature · 1 line
2.7.4