Skip to content

Implement overlayfs index=all mount option

Amir Goldstein linux-unionfs stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11ovl: fix EIO from lookup of non-indexed upperfs/overlayfs/inode.c fs/overlayfs/namei.c fs/overlayfs/overlayfs.h+34 -150 replies
2/11ovl: verify whiteout index entries on mountfs/overlayfs/namei.c+16 -80 replies
3/11ovl: create ovl_need_index() helperfs/overlayfs/copy_up.c fs/overlayfs/overlayfs.h fs/overlayfs/util.c+23 -90 replies
4/11ovl: add support for mount option index=allfs/overlayfs/overlayfs.h fs/overlayfs/ovl_entry.h fs/overlayfs/super.c +1 more+36 -110 replies
5/11ovl: lookup index for directoriesfs/overlayfs/namei.c+39 -130 replies
6/11ovl: verify directory index entries on mountfs/overlayfs/namei.c fs/overlayfs/overlayfs.h fs/overlayfs/readdir.c+45 -211 reply
7/11ovl: index directories on copy upfs/overlayfs/copy_up.c fs/overlayfs/util.c+118 -120 replies
8/11ovl: cleanup dir index when dir nlink drops to zerofs/overlayfs/util.c+3 -30 replies
9/11ovl: whiteout index when union nlink drops to zerofs/overlayfs/dir.c fs/overlayfs/overlayfs.h fs/overlayfs/util.c+50 -300 replies
10/11ovl: whiteout orphan index entries on mountfs/overlayfs/namei.c fs/overlayfs/overlayfs.h fs/overlayfs/readdir.c +1 more+63 -200 replies
11/11ovl: cleanup stale whiteout index entries on mountfs/overlayfs/namei.c+97 -560 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/11] Implement overlayfs index=all mount option

Miklos,

This is the second of two prep patch sets [1][2] for NFS export [3]. NFS export is enabled with the 'verify_dir' and 'index=all' mount options.

The requirement for 'index=all' can be relaxed if we create index for redirected dirs on lookup and for renamed non-dirs when encoding file handles. Decoding file handle will be more complex without index=all, so per your suggestion, this was not implemented for first version of NFS export.

The first two patches in this series are tagged for stable v4.13. The first patch I already posted, relaxes some index lookup constrains that we can do without.
The second patch allows kernel v4.13 to mount an overlay with whiteout index entries, which are being introduced by this patch set.

To sanity test index=all, I have implemented _overlay_check_fs() helper for xfstests [4], which is a very basic "fsck" of the index dir. This helper is called at the end of each overlay xfstest to verify the sanity of the index entries.

Amir.

[1] https://github.com/amir73il/linux/commits/ovl-verify-dir
[2] https://github.com/amir73il/linux/commits/ovl-index-all
[3] https://github.com/amir73il/linux/commits/ovl-nfs-export
[4] https://github.com/amir73il/xfstests/commits/ovl-index-all

Amir Goldstein (11):
ovl: fix EIO from lookup of non-indexed upper
ovl: verify whiteout index entries on mount
ovl: create ovl_need_index() helper
ovl: add support for mount option index=all
ovl: lookup index for directories
ovl: verify directory index entries on mount
ovl: index directories on copy up
ovl: cleanup dir index when dir nlink drops to zero
ovl: whiteout index when union nlink drops to zero
ovl: whiteout orphan index entries on mount
ovl: cleanup stale whiteout index entries on mount

 fs/overlayfs/copy_up.c   | 130 +++++++++++++++++---
 fs/overlayfs/dir.c       |  58 +++++----
 fs/overlayfs/inode.c     |  20 ++-
 fs/overlayfs/namei.c     | 314 +++++++++++++++++++++++++++++++++--------------
 fs/overlayfs/overlayfs.h |  29 ++++-
 fs/overlayfs/ovl_entry.h |   2 +-
 fs/overlayfs/readdir.c   |  48 ++++++--
 fs/overlayfs/super.c     |  28 +++--
 fs/overlayfs/util.c      |  55 ++++++---
 9 files changed, 505 insertions(+), 179 deletions(-)
Signature · 1 line
2.7.4