Skip to content

Overlayfs NFS export support

Amir Goldstein linux-fsdevel linux-unionfs 2 versions – Applied

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

  1. v2 Latest17 patches 50 repliesApplied
  2. v114 patches 7 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/17ovl: document NFS exportDocumentation/filesystems/overlayfs.txt+59 -06 replies
2/17ovl: encode pure upper file handlesfs/overlayfs/Makefile fs/overlayfs/export.c fs/overlayfs/overlayfs.h+106 -11 reply
3/17ovl: decode pure upper file handlesfs/overlayfs/export.c fs/overlayfs/namei.c fs/overlayfs/overlayfs.h+95 -215 replies
4/17ovl: decode connected upper dir file handlesfs/overlayfs/export.c+171 -117 replies
5/17ovl: encode non-indexed upper file handlesfs/overlayfs/export.c+23 -52 replies
6/17ovl: copy up before encoding dir file handle when ofs->numlower > 1fs/overlayfs/export.c+64 -20 replies
7/17ovl: encode lower file handlesfs/overlayfs/export.c+2 -80 replies
8/17ovl: decode lower non-dir file handlesfs/overlayfs/export.c fs/overlayfs/namei.c fs/overlayfs/overlayfs.h+50 -140 replies
9/17ovl: decode indexed non-dir file handlesfs/overlayfs/export.c+47 -251 reply
10/17ovl: decode lower file handles of unlinked but open filesfs/overlayfs/export.c fs/overlayfs/inode.c fs/overlayfs/overlayfs.h+37 -28 replies
11/17ovl: decode indexed dir file handlesfs/overlayfs/export.c fs/overlayfs/namei.c fs/overlayfs/overlayfs.h+15 -10 replies
12/17ovl: decode pure lower dir file handlesfs/overlayfs/export.c+12 -160 replies
13/17ovl: hash directory inodes for NFS exportfs/overlayfs/inode.c fs/overlayfs/super.c fs/overlayfs/util.c+13 -50 replies
14/17ovl: lookup connected ancestor of dir in inode cachefs/overlayfs/export.c fs/overlayfs/inode.c fs/overlayfs/overlayfs.h+93 -60 replies
15/17ovl: lookup indexed ancestor of lower dirfs/overlayfs/export.c fs/overlayfs/namei.c fs/overlayfs/overlayfs.h+54 -70 replies
16/17ovl: wire up NFS export supportfs/overlayfs/Kconfig fs/overlayfs/super.c+10 -00 replies
17/17nfsd: encode stat->mtime for getattr instead of inode->i_mtimefs/locks.c fs/nfsd/nfsxdr.c+3 -40 replies

Reviews trailers per patch

1 of 17 patches has a Reviewed-by or Acked-by.

PatchJeff 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/17R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

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