summaryrefslogtreecommitdiff
path: root/fs/overlayfs/util.c
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2023-04-02 21:56:49 +0300
committerAmir Goldstein <amir73il@gmail.com>2023-06-19 14:01:14 +0300
commit416656447864ef0fc2430525499f52a4a370a0ab (patch)
treea846326abea45b0377037ab32220364df3d98702 /fs/overlayfs/util.c
parent2b21da920866ad20b5e3119f3b8d2267774b7b0a (diff)
ovl: prepare for lazy lookup of lowerdata inode
Make the code handle the case of numlower > 1 and missing lowerdata dentry gracefully. Missing lowerdata dentry is an indication for lazy lookup of lowerdata and in that case the lowerdata_redirect path is stored in ovl_inode. Following commits will defer lookup and perform the lazy lookup on access. Reviewed-by: Alexander Larsson <alexl@redhat.com> 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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c
index 72f565f640fa..23c0224779be 100644
--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -159,7 +159,7 @@ void ovl_dentry_init_flags(struct dentry *dentry, struct dentry *upperdentry,
if (upperdentry)
flags |= upperdentry->d_flags;
- for (i = 0; i < ovl_numlower(oe); i++)
+ for (i = 0; i < ovl_numlower(oe) && lowerstack[i].dentry; i++)
flags |= lowerstack[i].dentry->d_flags;
spin_lock(&dentry->d_lock);