diff options
author | Amir Goldstein <amir73il@gmail.com> | 2023-04-27 12:21:46 +0300 |
---|---|---|
committer | Amir Goldstein <amir73il@gmail.com> | 2023-06-19 14:01:14 +0300 |
commit | 2b21da920866ad20b5e3119f3b8d2267774b7b0a (patch) | |
tree | 93b2c8fd6d67615cabfef1de618ec9bc73343c22 /fs/overlayfs/namei.c | |
parent | 5436ab0a864e8bb263919e51c26395a67bde17ca (diff) |
ovl: prepare to store lowerdata redirect for lazy lowerdata lookup
Prepare to allow ovl_lookup() to leave the last entry in a non-dir
lowerstack empty to signify lazy lowerdata lookup.
In this case, ovl_lookup() stores the redirect path from metacopy to
lowerdata in ovl_inode, which is going to be used later to perform the
lazy lowerdata lookup.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/namei.c')
-rw-r--r-- | fs/overlayfs/namei.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index 517f31a28f72..605108f0dbe9 100644 --- a/fs/overlayfs/namei.c +++ b/fs/overlayfs/namei.c @@ -1183,6 +1183,11 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry, .redirect = upperredirect, }; + /* Store lowerdata redirect for lazy lookup */ + if (ctr > 1 && !d.is_dir && !stack[ctr - 1].dentry) { + oip.lowerdata_redirect = d.redirect; + d.redirect = NULL; + } inode = ovl_get_inode(dentry->d_sb, &oip); err = PTR_ERR(inode); if (IS_ERR(inode)) |