OSDN Git Service

ovl: implement index dir copy up
authorAmir Goldstein <amir73il@gmail.com>
Tue, 20 Jun 2017 12:25:46 +0000 (15:25 +0300)
committerMiklos Szeredi <mszeredi@redhat.com>
Tue, 4 Jul 2017 20:03:19 +0000 (22:03 +0200)
commit59be09712ab98a3060f13e31343c7abb9bc4583d
tree5915d35f0fb5e0e7682b46d7042b20220ea30055
parentfd210b7d67ee3768bf1ad3e07d55797d4b45fcc1
ovl: implement index dir copy up

Implement a copy up method for non-dir objects using index dir to
prevent breaking lower hardlinks on copy up.

This method requires that the inodes index dir feature was enabled and
that all underlying fs support file handle encoding/decoding.

On the first lower hardlink copy up, upper file is created in index dir,
named after the hex representation of the lower origin inode file handle.
On the second lower hardlink copy up, upper file is found in index dir,
by the same lower handle key.
On either case, the upper indexed inode is then linked to the copy up
upper path.

The index entry remains linked for future lower hardlink copy up and for
lower to upper inode map, that is needed for exporting overlayfs to NFS.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/copy_up.c
fs/overlayfs/inode.c
fs/overlayfs/util.c