diff options
author | Amir Goldstein <amir73il@gmail.com> | 2023-04-27 13:39:09 +0300 |
---|---|---|
committer | Amir Goldstein <amir73il@gmail.com> | 2023-06-19 14:01:14 +0300 |
commit | 42dd69ae1af42cf72d167e63a039b8c63653eb7f (patch) | |
tree | da3f8b549fc66bfbf52747724869f7d9a2da28bb /fs/overlayfs/super.c | |
parent | 416656447864ef0fc2430525499f52a4a370a0ab (diff) |
ovl: implement lazy lookup of lowerdata in data-only layers
Defer lookup of lowerdata in the data-only layers to first data access
or before copy up.
We perform lowerdata lookup before copy up even if copy up is metadata
only copy up. We can further optimize this lookup later if needed.
We do best effort lazy lookup of lowerdata for d_real_inode(), because
this interface does not expect errors. The only current in-tree caller
of d_real_inode() is trace_uprobe and this caller is likely going to be
followed reading from the file, before placing uprobes on offset within
the file, so lowerdata should be available when setting the uprobe.
Tested-by: kernel test robot <oliver.sang@intel.com>
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/super.c')
-rw-r--r-- | fs/overlayfs/super.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index f3e5b43c4106..14a2ebdc8126 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -82,13 +82,14 @@ static struct dentry *ovl_d_real(struct dentry *dentry, return real; /* - * XXX: We may need lazy lookup of lowerdata for !inode case to return + * Best effort lazy lookup of lowerdata for !inode case to return * the real lowerdata dentry. The only current caller of d_real() with * NULL inode is d_real_inode() from trace_uprobe and this caller is * likely going to be followed reading from the file, before placing * uprobes on offset within the file, so lowerdata should be available * when setting the uprobe. */ + ovl_maybe_lookup_lowerdata(dentry); lower = ovl_dentry_lowerdata(dentry); if (!lower) goto bug; |