Skip to content

RFC overlayfs stable inodes

Amir Goldstein linux-fsdevel linux-unionfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest13 patches 29 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13ovl: check if all layers are on the same fsfs/overlayfs/overlayfs.h fs/overlayfs/ovl_entry.h fs/overlayfs/super.c +1 more+19 -10 replies
2/13ovl: redirect dir by file handle on copy upfs/overlayfs/Kconfig fs/overlayfs/copy_up.c fs/overlayfs/overlayfs.h +3 more+159 -211 replies
3/13ovl: lookup redirect by file handlefs/overlayfs/namei.c fs/overlayfs/overlayfs.h fs/overlayfs/util.c+168 -146 replies
4/13ovl: store file handle of stable inodefs/overlayfs/copy_up.c+3 -50 replies
5/13ovl: lookup stable inode by file handlefs/overlayfs/namei.c+22 -80 replies
6/13ovl: move inode helpers to inode.cfs/overlayfs/inode.c fs/overlayfs/overlayfs.h fs/overlayfs/util.c+20 -190 replies
7/13ovl: create helpers for initializing hashed inodefs/overlayfs/dir.c fs/overlayfs/inode.c+25 -80 replies
8/13ovl: allow hashing non upper inodesfs/overlayfs/inode.c fs/overlayfs/namei.c fs/overlayfs/overlayfs.h+12 -80 replies
9/13ovl: inherit overlay inode ino/generation from real inodefs/overlayfs/inode.c+12 -10 replies
10/13ovl: hash overlay inodes by stable inodefs/overlayfs/inode.c fs/overlayfs/namei.c+27 -40 replies
11/13ovl: fix du --one-file-system on overlay mountfs/overlayfs/inode.c+11 -00 replies
12/13ovl: constant ino across copy upfs/overlayfs/inode.c fs/overlayfs/namei.c fs/overlayfs/overlayfs.h +1 more+91 -90 replies
13/13ovl: try to hardlink upper on copy up of lower hardlinksfs/overlayfs/copy_up.c fs/overlayfs/inode.c fs/overlayfs/namei.c +1 more+91 -120 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC][PATCH 00/13] overlayfs stable inodes

Overlayfs inodes are considered unstable in several aspects, because on a copy up event:
1. st_ino can change
2. st_dev can change
3. hardlinks are broken
4. NFS handle would become stale
5. content of read-only file descriptor would become stale

This patch set 'stabilizes' overlayfs inodes w.r.t. st_ino/st_dev and takes some big steps in the direction of stabilizing hardlinks and NFS handles.

The full work is available at [1] and includes also an untested WIP for NFS export support.

This work relies heavily on inode and dentry cache - so long as the overlayfs dcache is fully populated, hardlinks should never be broken and NFS handles should never become stale on copy up.

The missing piece of the puzzle is a persistent mapping from lower entries to upper entries, so that overlay entries could be reconstructed from their stable (lower) unique identifier.

But the work has merit even without the missing piece, because it stabilizes st_ino/st_dev and prevents breaking hardlinks in many use cases.

[1] https://github.com/amir73il/linux/commits/ovl-nfs-export

Amir Goldstein (13):
ovl: check if all layers are on the same fs
ovl: redirect dir by file handle on copy up
ovl: lookup redirect by file handle
ovl: store file handle of stable inode
ovl: lookup stable inode by file handle
ovl: move inode helpers to inode.c
ovl: create helpers for initializing hashed inode
ovl: allow hashing non upper inodes
ovl: inherit overlay inode ino/generation from real inode
ovl: hash overlay inodes by stable inode
ovl: fix du --one-file-system on overlay mount
ovl: constant ino across copy up
ovl: try to hardlink upper on copy up of lower hardlinks

 fs/overlayfs/Kconfig     |  16 ++++
 fs/overlayfs/copy_up.c   | 130 ++++++++++++++++++++++++++-
 fs/overlayfs/dir.c       |   2 +-
 fs/overlayfs/inode.c     | 106 ++++++++++++++++++++--
 fs/overlayfs/namei.c     | 226 ++++++++++++++++++++++++++++++++++++++++++-----
 fs/overlayfs/overlayfs.h |  40 +++++++--
 fs/overlayfs/ovl_entry.h |   4 +-
 fs/overlayfs/readdir.c   |  85 ++++++++++++++++--
 fs/overlayfs/super.c     |  37 +++++++-
 fs/overlayfs/util.c      |  51 +++++++----
 10 files changed, 633 insertions(+), 64 deletions(-)
Signature · 1 line
2.7.4