diff options
author | Amir Goldstein <amir73il@gmail.com> | 2017-11-22 00:08:21 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2018-01-24 11:25:54 +0100 |
commit | fbd2d2074bde2e333d9a9eeda5864cd593fbe29c (patch) | |
tree | 23b19fd40218d8651c6b38fa7190f9b2f931665d | |
parent | 24b33ee104ecd5a4e1e71412f8966199d6a0bf02 (diff) | |
download | linux-stable-fbd2d2074bde2e333d9a9eeda5864cd593fbe29c.tar.gz linux-stable-fbd2d2074bde2e333d9a9eeda5864cd593fbe29c.tar.bz2 linux-stable-fbd2d2074bde2e333d9a9eeda5864cd593fbe29c.zip |
ovl: index all non-dir on copy up for NFS export
With the NFS export feature enabled, all non-dir are indexed on copy up.
The copy up origin inode of an indexed non-dir can be used as a unique
identifier of the overlay object.
The full index is also used for consistency verfication, like detecting
multiple non-hardlink uppers with the same 'origin' on lookup.
Directory index on copy up will be implemented by following patch.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
-rw-r--r-- | fs/overlayfs/util.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 55ab99131a72..7cb930e367be 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -473,6 +473,10 @@ bool ovl_need_index(struct dentry *dentry) if (!lower || !ovl_indexdir(dentry->d_sb)) return false; + /* Index all files for NFS export and consistency verification */ + if (!d_is_dir(lower) && ovl_index_all(dentry->d_sb)) + return true; + /* Index only lower hardlinks on copy up */ if (!d_is_dir(lower) && d_inode(lower)->i_nlink > 1) return true; |