Skip to content

Overlayfs inodes index

Amir Goldstein linux-fsdevel linux-unionfs 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest25 patches 4 repliesIn review
  2. v323 patches 5 repliesSuperseded
  3. v2 posting 2/220 patches 17 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v2 posting 1/25 patches0 repliesSuperseded
v12 patches8 repliesSuperseded

Changes in v4 from the cover letter

- Persistent overlay nlink accounting
- Cleanup index when overlay nlink drops to zero
- Cleanup stale and orphan index entries on mount
- Update documentation w.r.t inodes index feature

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/25vfs: introduce inode 'inuse' lockfs/inode.c include/linux/fs.h+64 -00 replies
2/25ovl: get exclusive ownership on upper/work dirsfs/overlayfs/ovl_entry.h fs/overlayfs/super.c+41 -30 replies
3/25ovl: relax same fs constrain for ovl_check_origin()fs/overlayfs/namei.c+25 -180 replies
4/25ovl: generalize ovl_create_workdir()fs/overlayfs/super.c+29 -160 replies
5/25ovl: introduce the inodes index dir featurefs/overlayfs/Kconfig fs/overlayfs/copy_up.c fs/overlayfs/overlayfs.h +3 more+108 -80 replies
6/25ovl: verify upper root dir matches lower root dirfs/overlayfs/copy_up.c fs/overlayfs/namei.c fs/overlayfs/overlayfs.h +1 more+101 -150 replies
7/25ovl: verify index dir matches upper dirfs/overlayfs/copy_up.c fs/overlayfs/namei.c fs/overlayfs/overlayfs.h +1 more+27 -80 replies
8/25ovl: store path type in dentryfs/overlayfs/namei.c fs/overlayfs/overlayfs.h fs/overlayfs/ovl_entry.h +2 more+23 -30 replies
9/25ovl: cram dentry state booleans into type flagsfs/overlayfs/namei.c fs/overlayfs/overlayfs.h fs/overlayfs/ovl_entry.h +2 more+30 -230 replies
10/25ovl: lookup index entry for copy up originfs/overlayfs/inode.c fs/overlayfs/namei.c fs/overlayfs/overlayfs.h+115 -20 replies
11/25ovl: cleanup bad and stale index entries on mountfs/overlayfs/dir.c fs/overlayfs/namei.c fs/overlayfs/overlayfs.h +2 more+130 -100 replies
12/25ovl: allocate an ovl_inode structfs/overlayfs/ovl_entry.h fs/overlayfs/super.c+72 -20 replies
13/25ovl: store upper/lower real inode in ovl_inode_infofs/overlayfs/inode.c fs/overlayfs/overlayfs.h fs/overlayfs/ovl_entry.h +2 more+41 -180 replies
14/25ovl: use ovl_inode_init() for initializing new inodefs/overlayfs/dir.c fs/overlayfs/inode.c fs/overlayfs/namei.c +1 more+12 -40 replies
15/25ovl: hash overlay non-dir inodes by copy up origin inodefs/overlayfs/copy_up.c fs/overlayfs/inode.c fs/overlayfs/namei.c +2 more+102 -150 replies
16/25ovl: defer upper dir lock to tempfile linkfs/overlayfs/copy_up.c fs/overlayfs/util.c+20 -180 replies
17/25ovl: factor out ovl_copy_up_inode() helperfs/overlayfs/copy_up.c+37 -270 replies
18/25ovl: generalize ovl_copy_up_locked() using actorsfs/overlayfs/copy_up.c+172 -780 replies
19/25ovl: generalize ovl_copy_up_one() using actorsfs/overlayfs/copy_up.c+56 -250 replies
20/25ovl: use ovl_inode mutex to synchronize concurrent copy upfs/overlayfs/ovl_entry.h fs/overlayfs/super.c fs/overlayfs/util.c+6 -210 replies
21/25ovl: implement index dir copy up methodDocumentation/filesystems/overlayfs.txt fs/overlayfs/copy_up.c fs/overlayfs/overlayfs.h +1 more+216 -110 replies
22/25ovl: link up indexed lower hardlink on lookupfs/overlayfs/namei.c fs/overlayfs/super.c+51 -80 replies
23/25ovl: fix nlink leak in ovl_rename()fs/overlayfs/dir.c+6 -00 replies
24/25ovl: persistent overlay inode nlink for indexed inodesfs/overlayfs/copy_up.c fs/overlayfs/dir.c fs/overlayfs/inode.c +2 more+245 -341 reply
25/25ovl: cleanup orphan index entriesfs/overlayfs/dir.c fs/overlayfs/inode.c fs/overlayfs/namei.c +2 more+83 -40 replies
25/25ovl: cleanup orphan index entriesfs/overlayfs/copy_up.c fs/overlayfs/dir.c fs/overlayfs/inode.c +3 more+102 -70 replies

Reviews trailers per patch

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

Read the v4 thread

Cover letter [PATCH v4 00/25] Overlayfs inodes index

Miklos,

This is it.
All done on my end, so unless you have any rejects that you want me to fix, you may start mangling.

I've added another xfstest for nlink accounting and may add another one that mangles with lower hardlinks to get negative overlay nlink. It's a behavior I observed with lower/upper stress xfstest overlay/019 and fixed in patch 25.

Given the state of affairs with consistent d_ino patches, I suggest that we focus on herding the inode index patches towards linux-next before anything else.

Thanks,
Amir.

This work introduces the inodes index opt-in feature, which provides:
- Hardlinks are not broken on copy up
- Infrastructure for overlayfs NFS export

The work is available on my ovl-hardlinks.v4 branch [1]. For the curious, documentation about how overlay NFS export would work with the inodes index is available in the linked commit [2].

The most significant change w.r.t. vfs is that with inodes index, overlay inodes are hashed and unique throughout the lifecycle of an overlay object (i.e. across copy up). This is required for not breaking hardlinks on copy up.

Hardlink copy up tests including coverage for concurrent copy up of lower hardlinks, lower/upper hardlinks consistency and union nlink accounting are available on my xfstests dev branch [3].

This work also fixes constant st_ino for samefs case for lower hardlinks, so the few constant st_ino tests that fail on v4.12-rc1 due to copy up of lower hardlinks now pass [3][4].

Changes since v3:
- Persistent overlay nlink accounting
- Cleanup index when overlay nlink drops to zero
- Cleanup stale and orphan index entries on mount
- Update documentation w.r.t inodes index feature

Changes v1..v2:
- Introduce ovl_inode and ovl_inode mutex
- Synchronize copy up with ovl_inode mutex
- Don't store index dentry in overlay dentry
- Consistency of lower/upper hardlinks by link-up on lookup
- Preemptive copy up before lower hardlink unlink

[1] https://github.com/amir73il/linux/commits/ovl-hardlinks.v4
[2] https://github.com/amir73il/linux/commits/ovl-nfs-export
[3] https://github.com/amir73il/xfstests/commits/overlayfs-devel
[4] https://github.com/amir73il/unionmount-testsuite/commits/overlayfs-devel

Amir Goldstein (25):
vfs: introduce inode 'inuse' lock
ovl: get exclusive ownership on upper/work dirs
ovl: relax same fs constrain for ovl_check_origin()
ovl: generalize ovl_create_workdir()
ovl: introduce the inodes index dir feature
ovl: verify upper root dir matches lower root dir
ovl: verify index dir matches upper dir
ovl: store path type in dentry
ovl: cram dentry state booleans into type flags
ovl: lookup index entry for copy up origin
ovl: cleanup bad and stale index entries on mount
ovl: allocate an ovl_inode struct
ovl: store upper/lower real inode in ovl_inode_info
ovl: use ovl_inode_init() for initializing new inode
ovl: hash overlay non-dir inodes by copy up origin inode
ovl: defer upper dir lock to tempfile link
ovl: factor out ovl_copy_up_inode() helper
ovl: generalize ovl_copy_up_locked() using actors
ovl: generalize ovl_copy_up_one() using actors
ovl: use ovl_inode mutex to synchronize concurrent copy up
ovl: implement index dir copy up method
ovl: link up indexed lower hardlink on lookup
ovl: fix nlink leak in ovl_rename()
ovl: persistent overlay inode nlink for indexed inodes
ovl: cleanup orphan index entries

 Documentation/filesystems/overlayfs.txt |   6 +-
 fs/inode.c                              |  50 +++
 fs/overlayfs/Kconfig                    |  20 +
 fs/overlayfs/copy_up.c                  | 625 +++++++++++++++++++++++++-------
 fs/overlayfs/dir.c                      | 164 ++++++++-
 fs/overlayfs/inode.c                    | 160 +++++++-
 fs/overlayfs/namei.c                    | 382 ++++++++++++++++---
 fs/overlayfs/overlayfs.h                |  47 ++-
 fs/overlayfs/ovl_entry.h                |  37 +-
 fs/overlayfs/readdir.c                  |  50 +++
 fs/overlayfs/super.c                    | 286 +++++++++++++--
 fs/overlayfs/util.c                     | 164 +++++++--
 include/linux/fs.h                      |  14 +
 13 files changed, 1723 insertions(+), 282 deletions(-)
Signature · 1 line
2.7.4