summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/util.c
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@mykernel.net>2020-04-24 04:55:17 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2020-05-13 11:11:24 +0200
commitc21c839b8448dd4b1e37ffc1bde928f57d34c0db (patch)
tree72887c93eebea1c78fbd61d032cbc06191d082f4 /fs/overlayfs/util.c
parentovl: inherit SB_NOSEC flag from upperdir (diff)
downloadlinux-c21c839b8448dd4b1e37ffc1bde928f57d34c0db.tar.xz
linux-c21c839b8448dd4b1e37ffc1bde928f57d34c0db.zip
ovl: whiteout inode sharing
Share inode with different whiteout files for saving inode and speeding up delete operation. If EMLINK is encountered when linking a shared whiteout, create a new one. In case of any other error, disable sharing for this super block. Note: ofs->whiteout is protected by inode lock on workdir. Signed-off-by: Chengguang Xu <cgxu519@mykernel.net> Reviewed-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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c
index 36b60788ee47..01755bc186c9 100644
--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -707,7 +707,8 @@ static void ovl_cleanup_index(struct dentry *dentry)
index = NULL;
} else if (ovl_index_all(dentry->d_sb)) {
/* Whiteout orphan index to block future open by handle */
- err = ovl_cleanup_and_whiteout(indexdir, dir, index);
+ err = ovl_cleanup_and_whiteout(OVL_FS(dentry->d_sb),
+ dir, index);
} else {
/* Cleanup orphan index entries */
err = ovl_cleanup(dir, index);