diff options
author | Amir Goldstein <amir73il@gmail.com> | 2017-06-20 14:25:46 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2017-07-04 22:03:19 +0200 |
commit | 59be09712ab98a3060f13e31343c7abb9bc4583d (patch) | |
tree | 5915d35f0fb5e0e7682b46d7042b20220ea30055 /fs/overlayfs/util.c | |
parent | ovl: move copy up lock out (diff) | |
download | linux-59be09712ab98a3060f13e31343c7abb9bc4583d.tar.xz linux-59be09712ab98a3060f13e31343c7abb9bc4583d.zip |
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>
Diffstat (limited to 'fs/overlayfs/util.c')
-rw-r--r-- | fs/overlayfs/util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 38fa75228c66..a290be449b8b 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -302,7 +302,7 @@ int ovl_copy_up_start(struct dentry *dentry) int err; err = mutex_lock_interruptible(&oi->lock); - if (!err && ovl_dentry_upper(dentry)) { + if (!err && ovl_dentry_has_upper_alias(dentry)) { err = 1; /* Already copied up */ mutex_unlock(&oi->lock); } |