Handle notifications on overlayfs fake path files
Subsystems (5)
Amir Goldstein
maintainerv2 cover Handle notifications on overlayfs fake path files
Miklos,
The first solution that we discussed for removing FMODE_NONOTIFY from overlayfs real files using file_fake container got complicated.
This alternative solution is less intrusive to vfs and all the vfs code should remian unaffected expect for the special fsnotify case that we want to fix.
Thanks,
Amir.
Changes since v1:
- Drop the file_fake container
- Leave f_path fake and special case only fsnotify
[1] https://github.com/amir73il/linux/commits/ovl_real_path
Amir Goldstein (3):
fs: rename FMODE_NOACCOUNT to FMODE_INTERNAL
fs: introduce f_real_path() helper
ovl: enable fsnotify events on underlying real files
Documentation/filesystems/locking.rst | 3 ++- Documentation/filesystems/vfs.rst | 3 ++- fs/file_table.c | 29 ++++++++++++++++++++++++--- fs/internal.h | 5 +++-- fs/namei.c | 2 +- fs/open.c | 2 +- fs/overlayfs/file.c | 4 ++-- fs/overlayfs/super.c | 27 ++++++++++++++++--------- include/linux/dcache.h | 11 ++++++---- include/linux/fs.h | 8 +++++--- include/linux/fsnotify.h | 6 ++++-- 11 files changed, 71 insertions(+), 29 deletions(-)
Signature · 1 line
2.34.1
Amir Goldstein
maintainerPATCH v2 1/3 fs: rename FMODE_NOACCOUNT to FMODE_INTERNAL
Rename the flag FMODE_NOACCOUNT that is used to mark internal files of overlayfs and cachefiles to the more generic name FMODE_INTERNAL, which also indicates that the file's f_path is possibly "fake".
--- fs/file_table.c | 6 +++--- fs/internal.h | 5 +++-- fs/namei.c | 2 +- fs/open.c | 2 +- include/linux/fs.h | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-)
fs/file_table.c +3 -3
@@ -55,7 +55,7 @@ static void file_free_rcu(struct rcu_head *head)static inline void file_free (struct file *f) {security_file_free (f); -if (!(f->f_mode &FMODE_NOACCOUNT )) +if (!(f->f_mode &FMODE_INTERNAL ))percpu_counter_dec (&nr_files);call_rcu (&f->f_rcuhead, file_free_rcu); }
@@ -205,12 +205,12 @@ struct file *alloc_empty_file(int flags, const struct cred *cred)* * Should not be used unless there's a very good reason to do so. */ -struct file *alloc_empty_file_noaccount (int flags,const struct cred *cred) +struct file *alloc_empty_file_internal (int flags,const struct cred *cred) {struct file *f =__alloc_file (flags, cred);if (!IS_ERR (f)) - f->f_mode |=FMODE_NOACCOUNT ; + f->f_mode |=FMODE_INTERNAL ;return f; }
fs/internal.h +3 -2
@@ -97,8 +97,9 @@ extern void chroot_fs_refs(const struct path *, const struct path *);/* * file_table.c */ -extern struct file *alloc_empty_file (int ,const struct cred *); -extern struct file *alloc_empty_file_noaccount (int ,const struct cred *); +extern struct file *alloc_empty_file (int flags,const struct cred *cred); +extern struct file *alloc_empty_file_internal (int flags, +const struct cred *cred);static inline void put_file_access (struct file *file) {
fs/namei.c +1 -1
@@ -3721,7 +3721,7 @@ struct file *vfs_tmpfile_open(struct mnt_idmap *idmap,struct file *file;int error; - file =alloc_empty_file_noaccount (open_flag, cred); + file =alloc_empty_file_internal (open_flag, cred);if (!IS_ERR (file)) { error =vfs_tmpfile (idmap, parentpath, file, mode);if (error) {
fs/open.c +1 -1
@@ -1124,7 +1124,7 @@ EXPORT_SYMBOL(dentry_create);struct file *open_with_fake_path (const struct path *path,int flags,struct inode *inode,const struct cred *cred) { -struct file *f =alloc_empty_file_noaccount (flags, cred); +struct file *f =alloc_empty_file_internal (flags, cred);if (!IS_ERR (f)) {int error;
include/linux/fs.h +2 -2
@@ -180,8 +180,8 @@ typedef int (dio_iodone_t)(struct kiocb *iocb, loff_t offset,/* File represents mount that needs unmounting */ #define FMODE_NEED_UNMOUNT ((__force fmode_t)0x10000000) -/* File does not contribute to nr_files count */ -#define FMODE_NOACCOUNT ((__force fmode_t)0x20000000) +/* File is kernel internal does not contribute to nr_files count */ +#define FMODE_INTERNAL ((__force fmode_t)0x20000000)/* File supports async buffered reads */ #define FMODE_BUF_RASYNC ((__force fmode_t)0x40000000)
Signature · 1 line
2.34.1
Re: [PATCH v2 1/3] fs: rename FMODE_NOACCOUNT to FMODE_INTERNAL
Quoted 3 lines · Amir Goldstein
Rename the flag
FMODE_NOACCOUNTthat is used to mark internal files of overlayfs and cachefiles to the more generic nameFMODE_INTERNAL, which also indicates that the file'sf_pathis possibly "fake".
FMODE_INTERNAL is completely meaningless. Plase come up with a name that actually explain what is special about these files.
Amir Goldstein
maintainerRe: [PATCH v2 1/3] fs: rename FMODE_NOACCOUNT to FMODE_INTERNAL
Quoted 9 lines · Christoph Hellwig
Quoted 3 lines · Amir Goldstein
Rename the flag
FMODE_NOACCOUNTthat is used to mark internal files of overlayfs and cachefiles to the more generic nameFMODE_INTERNAL, which also indicates that the file'sf_pathis possibly "fake".
FMODE_INTERNALis completely meaningless. Plase come up with a name that actually explain what is special about these files.
Well, I am not sure if FMODE_FAKE_PATH in v3 is a better name, because you did rightfully say that "fake path" is not that descriptive, but I will think of a better way to describe "fake path" and match the flag to the file container name.
Thanks,
Amir.
Re: [PATCH v2 1/3] fs: rename FMODE_NOACCOUNT to FMODE_INTERNAL
Quoted 4 lines · Amir Goldstein
Well, I am not sure if
FMODE_FAKE_PATHin v3 is a better name, because you did rightfully say that "fake path" is not that descriptive, but I will think of a better way to describe "fake path" and match the flag to the file container name.
I suspect the just claling it out what it is and naming it FMODE_OVERLAYFS might be a good idea. We'd just need to make sure not to set it for the cachefiles use case, which is probably a good idea anyway.
Re: [PATCH v2 1/3] fs: rename FMODE_NOACCOUNT to FMODE_INTERNAL
Quoted 10 lines · Christoph Hellwig
Quoted 4 lines · Amir Goldstein
Well, I am not sure if
FMODE_FAKE_PATHin v3 is a better name, because you did rightfully say that "fake path" is not that descriptive, but I will think of a better way to describe "fake path" and match the flag to the file container name.I suspect the just claling it out what it is and naming it
FMODE_OVERLAYFSmight be a good idea. We'd just need to make sure not to set it for the cachefiles use case, which is probably a good idea anyway.
Adding Dave:
not sure if I'm missing something, but is there any good reason cachefs doesn't juse use dentry_open() ?
Amir Goldstein
maintainerRe: [PATCH v2 1/3] fs: rename FMODE_NOACCOUNT to FMODE_INTERNAL
In reply to Christoph HellwigQuoted 11 lines · Christoph Hellwig
Quoted 4 lines · Amir Goldstein
Well, I am not sure if
FMODE_FAKE_PATHin v3 is a better name, because you did rightfully say that "fake path" is not that descriptive, but I will think of a better way to describe "fake path" and match the flag to the file container name.I suspect the just claling it out what it is and naming it
FMODE_OVERLAYFSmight be a good idea. We'd just need to make sure not to set it for the cachefiles use case, which is probably a good idea anyway.
Agree to both.
As I told Christian, I was reluctant to use the last available flag bit (although you did free up a couple of flags:)), but making FMODE_OVERLAYFS overlayfs only and keeping cachefiles with FMODE_NOACCOUNT would be the cleaner thing to do.
Thanks,
Amir.
Re: [PATCH v2 1/3] fs: rename FMODE_NOACCOUNT to FMODE_INTERNAL
Quoted 5 lines · Amir Goldstein
Agree to both.
As I told Christian, I was reluctant to use the last available flag bit (although you did free up a couple of flags:)), but makingFMODE_OVERLAYFSoverlayfs only and keeping cachefiles withFMODE_NOACCOUNTwould be the cleaner thing to do.
Please go ahead with the bit. In addition to the block series I plan to move all static flags from f_mode to a new f_op.flags field in the next merge window, which should help with avaiability.
Amir Goldstein
maintainerPATCH v2 2/3 fs: introduce f_real_path() helper
In reply to Amir GoldsteinOverlayfs knows the real path of underlying dentries. Add an optional struct vfsmount out argument to ->d_real(), so callers could compose the real path.
Add a helper f_real_path() that uses this new interface to return the real path of f_inode, for overlayfs internal files whose f_path if a "fake" overlayfs path and f_inode is the underlying real inode.
--- Documentation/filesystems/locking.rst | 3 ++- Documentation/filesystems/vfs.rst | 3 ++- fs/file_table.c | 23 +++++++++++++++++++++++ fs/overlayfs/super.c | 27 ++++++++++++++++++--------- include/linux/dcache.h | 11 +++++++---- include/linux/fs.h | 4 +++- 6 files changed, 55 insertions(+), 16 deletions(-)
Documentation/filesystems/locking.rst +2 -1
@@ -29,7 +29,8 @@ prototypes:: char *(*d_dname)((struct dentry *dentry, char *buffer, int buflen); struct vfsmount *(*d_automount)(struct path *path); int (*d_manage)(const struct path *, bool); - struct dentry *(*d_real)(struct dentry *, const struct inode *); + struct dentry *(*d_real)(struct dentry *, const struct inode *, + struct vfsmount **pmnt); locking rules:
Documentation/filesystems/vfs.rst +2 -1
@@ -1264,7 +1264,8 @@ defined: char *(*d_dname)(struct dentry *, char *, int); struct vfsmount *(*d_automount)(struct path *); int (*d_manage)(const struct path *, bool); - struct dentry *(*d_real)(struct dentry *, const struct inode *); + struct dentry *(*d_real)(struct dentry *, const struct inode *, + struct vfsmount **pmnt); }; ``d_revalidate``
fs/file_table.c +23 -0
@@ -215,6 +215,29 @@ struct file *alloc_empty_file_internal(int flags, const struct cred *cred)return f; } +/** +* f_real_path - return the real path of an internal file with fake path +* +* @file: The file to query +* +* If f_path is on a union/overlay and f_inode is not, then return the +* underlying real path of f_inode. +* Otherwise return f_path (by value). +*/ +struct path f_real_path (const struct file *f) +{ +struct path path; + +if (!(f->f_mode &FMODE_INTERNAL ) || + (d_inode (f->f_path.dentry) == f->f_inode)) +return f->f_path; + + path.mnt = f->f_path.mnt; + path.dentry =d_real (f->f_path.dentry, f->f_inode, &path.mnt); +return path; +} +EXPORT_SYMBOL (f_real_path); +/** * alloc_file - allocate and initialize a 'struct file' *
fs/overlayfs/super.c +18 -9
@@ -60,9 +60,11 @@ MODULE_PARM_DESC(metacopy, "Default to on or off for the metadata only copy up feature");static struct dentry *ovl_d_real (struct dentry *dentry, -const struct inode *inode) +const struct inode *inode, +struct vfsmount **pmnt) {struct dentry *real =NULL , *lower; +struct path realpath;/* It's an overlay file */ if (inode &&d_inode (dentry) == inode)
@@ -74,12 +76,13 @@ static struct dentry *ovl_d_real(struct dentry *dentry, goto bug; } - real =ovl_dentry_upper (dentry); +ovl_path_upper (dentry, &realpath); + real = realpath.dentry;if (real && (inode ==d_inode (real))) -return real; + goto found;if (real && !inode &&ovl_has_upperdata (d_inode (dentry))) -return real; + goto found;/* * Best effort lazy lookup of lowerdata for !inode case to return
@@ -90,16 +93,22 @@ static struct dentry *ovl_d_real(struct dentry *dentry,* when setting the uprobe. */ ovl_maybe_lookup_lowerdata (dentry); - lower =ovl_dentry_lowerdata (dentry); +ovl_path_lowerdata (dentry, &realpath); + lower = realpath.dentry;if (!lower) goto bug; - real = lower;/* Handle recursion */ - real =d_real (real, inode); + real =d_real (lower, inode, &realpath.mnt); + +if (inode && inode !=d_inode (real)) + goto bug; + +found: +if (pmnt) + *pmnt = realpath.mnt; +return real; -if (!inode || inode ==d_inode (real)) -return real; bug: WARN(1, "%s(%pd4, %s:%lu): real dentry (%p/%lu) not found\n", __func__, dentry, inode ? inode->i_sb->s_id : "NULL",
include/linux/dcache.h +7 -4
@@ -139,7 +139,8 @@ struct dentry_operations {char *(*d_dname)(struct dentry *,char *,int );struct vfsmount *(*d_automount)(struct path *);int (*d_manage)(const struct path *,bool ); -struct dentry *(*d_real)(struct dentry *,const struct inode *); +struct dentry *(*d_real)(struct dentry *,const struct inode *, +struct vfsmount **); }____cacheline_aligned ;/*
@@ -564,6 +565,7 @@ static inline struct dentry *d_backing_dentry(struct dentry *upper)* d_real - Return the real dentry * @dentry: the dentry to query * @inode: inode to select the dentry from multiple layers (can be NULL) +* @pmnt: returns the real mnt in case @dentry is not real * * If dentry is on a union/overlay, then return the underlying, real dentry. * Otherwise return the dentry itself.
@@ -571,10 +573,11 @@ static inline struct dentry *d_backing_dentry(struct dentry *upper)* See also: Documentation/filesystems/vfs.rst */ static inline struct dentry *d_real (struct dentry *dentry, -const struct inode *inode) +const struct inode *inode, +struct vfsmount **pmnt) {if (unlikely (dentry->d_flags &DCACHE_OP_REAL )) -return dentry->d_op->d_real (dentry, inode); +return dentry->d_op->d_real (dentry, inode, pmnt);else return dentry; }
@@ -589,7 +592,7 @@ static inline struct dentry *d_real(struct dentry *dentry,static inline struct inode *d_real_inode (const struct dentry *dentry) {/* This usage of d_real() results in const dentry */ -return d_backing_inode (d_real ((struct dentry *) dentry,NULL )); +return d_inode (d_real ((struct dentry *) dentry,NULL ,NULL )); }struct name_snapshot {
include/linux/fs.h +3 -1
@@ -1042,7 +1042,7 @@ static inline struct inode *file_inode(const struct file *f)static inline struct dentry *file_dentry (const struct file *file) { -return d_real (file->f_path.dentry,file_inode (file)); +return d_real (file->f_path.dentry,file_inode (file),NULL ); }struct fasync_struct {
@@ -2354,6 +2354,8 @@ extern struct file *dentry_create(const struct path *path, int flags, umode_t mode, const struct cred *cred);extern struct file *open_with_fake_path (const struct path *,int ,struct inode *,const struct cred *); +extern struct path f_real_path (const struct file *f); +static inline struct file *file_clone_open (struct file *file) {return dentry_open (&file->f_path, file->f_flags, file->f_cred);
Signature · 1 line
2.34.1
Re: [PATCH v2 2/3] fs: introduce f_real_path() helper
Quoted 7 lines · Amir Goldstein
Overlayfs knows the real path of underlying dentries. Add an optional struct vfsmount out argument to ->d_real(), so callers could compose the real path.
Add a helper
f_real_path()that uses this new interface to return the real path off_inode, for overlayfs internal files whosef_pathif a "fake" overlayfs path andf_inodeis the underlying real inode.
I really don't like this ->d_real nagic. Most callers of it really can't ever be on overlayfs. So I'd suggest we do an audit of the callers of file_dentry and drop all the pointless ones first, and improve the documentation on when to use it.
Amir Goldstein
maintainerRe: [PATCH v2 2/3] fs: introduce f_real_path() helper
Quoted 6 lines · Christoph Hellwig
Quoted 4 lines · Amir Goldstein
Overlayfs knows the real path of underlying dentries. Add an optional struct vfsmount out argument to ->d_real(), so callers could compose the real path.
Quoted 6 lines
Quoted 3 lines
Add a helper
f_real_path()that uses this new interface to return the real path off_inode, for overlayfs internal files whosef_pathif a "fake" overlayfs path andf_inodeis the underlying real inode.I really don't like this ->d_real nagic. Most callers of it really can't ever be on overlayfs.
Which callers are you referring to?
Quoted 3 lines
So I'd suggest we do an audit
of the callers offile_dentryand drop all the pointless ones first, and improve the documentation on when to use it.
Well, v3 is trying to reduce ->d_real() magic and the step after introducing the alternative path container is to convert file_dentry() to use the stored real_path instead of ->d_real().
But I agree that the documentation about this black magic is missing. Will try to improve that with the move to the "fake" file container.
Thanks,
Amir.
Re: [PATCH v2 2/3] fs: introduce f_real_path() helper
Quoted 7 lines · Amir Goldstein
Quoted 6 lines · Christoph Hellwig
Quoted 4 lines · Amir Goldstein
Overlayfs knows the real path of underlying dentries. Add an optional struct vfsmount out argument to ->d_real(), so callers could compose the real path.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Add a helper
f_real_path()that uses this new interface to return the real path off_inode, for overlayfs internal files whosef_pathif a "fake" overlayfs path andf_inodeis the underlying real inode.I really don't like this ->d_real nagic. Most callers of it really can't ever be on overlayfs.
Which callers are you referring to?
Most users of file_dentry are inside file systems and will never see the overlayfs path.
Quoted 7 lines
Quoted 3 lines
So I'd suggest we do an audit
of the callers offile_dentryand drop all the pointless ones first, and improve the documentation on when to use it.Well, v3 is trying to reduce ->d_real() magic and the step after introducing the alternative path container is to convert
file_dentry()to use the storedreal_pathinstead of ->d_real().
Yeah, that makes this comment kinda irrelevant.
Amir Goldstein
maintainerRe: [PATCH v2 2/3] fs: introduce f_real_path() helper
Quoted 13 lines · Christoph Hellwig
Quoted 11 lines · Amir Goldstein
Quoted 10 lines · Christoph Hellwig
Quoted 7 lines · Amir Goldstein
Overlayfs knows the real path of underlying dentries. Add an optional struct vfsmount out argument to ->d_real(), so callers could compose the real path.
Add a helper
f_real_path()that uses this new interface to return the real path off_inode, for overlayfs internal files whosef_pathif a "fake" overlayfs path andf_inodeis the underlying real inode.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
I really don't like this ->d_real nagic. Most callers of it really can't ever be on overlayfs.
Which callers are you referring to?
Most users of
file_dentryare inside file systems and will never see the overlayfs path.
Ay ay ay.
I suspected that this is what you meant and I do not blame you. There is no documentation and it is hard to understand what is going on even harder to understand why that is going on...
Before "ovl: stack file ops" series, a file opened from ovl (over xfs) path would have ovl f_path and xfs f_inode, as well as xfs f_ops, so indeed xfs code had to be careful, but so did a lot of generic vfs code.
After ovl stacked f_ops, a file opened from ovl (over xfs) path has an ovl f_path and an ovl f_inode, so a lot of hacks could be removed from generic vfs code (e.g. locks_inode() macro).
Alas, for every ovl file, there is an "internal/real" file (stashed in file->f_private)
which is opened by open_with_fake_path().
This "internal/real" file has ovl f_path and xfs f_inode, so xfs could not get rid
of file_dentry() just yet.
Currently, the reason for the fake f_path hack is that the same internal file is assigned as ->vm_file in ovl_mmap(), ovl does not implement stacked aops and some users of ->vm_file need the "fake" ovl path.
Anyway, the first step is to introduce the ovl internal file container. Next, we will use the real_path for file_dentry() and we can see if we can get rid of some of these file_dentry() uses.
Thanks,
Amir.
Amir Goldstein
maintainerPATCH v2 3/3 ovl: enable fsnotify events on underlying real files
In reply to Amir GoldsteinOverlayfs creates the real underlying files with fake f_path, whose f_inode is on the underlying fs and f_path on overlayfs.
Those real files were open with FMODE_NONOTIFY, because fsnotify code was not prapared to handle fsnotify hooks on files with fake path correctly and fanotify would report unexpected event->fd with fake overlayfs path, when the underlying fs was being watched.
Teach fsnotify to handle events on the real files, and do not set real files to FMODE_NONOTIFY to allow operations on real file (e.g. open, access, modify, close) to generate async and permission events.
Because fsnotify does not have notifications on address space operations, we do not need to worry about ->vm_file not reporting events to a watched overlayfs when users are accessing a mapped overlayfs file.
--- fs/overlayfs/file.c | 4 ++-- include/linux/fsnotify.h | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-)
fs/overlayfs/file.c +2 -2
@@ -34,8 +34,8 @@ static char ovl_whatisit(struct inode *inode, struct inode *realinode)return 'm' ; } -/* No atime modification nor notify on underlying */ -#define OVL_OPEN_FLAGS (O_NOATIME | FMODE_NONOTIFY) +/* No atime modification on underlying */ +#define OVL_OPEN_FLAGS (O_NOATIME)static struct file *ovl_open_realfile (const struct file *file,const struct path *realpath)
include/linux/fsnotify.h +4 -2
@@ -91,12 +91,14 @@ static inline void fsnotify_dentry(struct dentry *dentry, __u32 mask)static inline int fsnotify_file (struct file *file,__u32 mask) { -const struct path *path = &file->f_path; +struct path path;if (file->f_mode &FMODE_NONOTIFY )return 0 ; -return fsnotify_parent (path->dentry, mask, path,FSNOTIFY_EVENT_PATH ); +/* Overlayfs internal files have fake f_path */ + path =f_real_path (file); +return fsnotify_parent (path.dentry, mask, &path,FSNOTIFY_EVENT_PATH ); }/* Simple call site for access decisions */
Signature · 1 line
2.34.1
Miklos Szeredi
maintainerQuoted 10 lines · Amir Goldstein
Miklos,
The first solution that we discussed for removing
FMODE_NONOTIFYfrom overlayfs real files usingfile_fakecontainer got complicated.This alternative solution is less intrusive to vfs and all the vfs code should remian unaffected expect for the special fsnotify case that we want to fix.
Quoted 5 lines
Thanks,
Amir.Changes since v1:
- Drop thefile_fakecontainer
Why?
Thanks,
Miklos
Amir Goldstein
maintainerQuoted 12 lines · Miklos Szeredi
Quoted 10 lines · Amir Goldstein
Miklos,
The first solution that we discussed for removing
FMODE_NONOTIFYfrom overlayfs real files usingfile_fakecontainer got complicated.This alternative solution is less intrusive to vfs and all the vfs code should remian unaffected expect for the special fsnotify case that we want to fix.
Quoted 7 lines
Quoted 5 lines
Thanks,
Amir.Changes since v1:
- Drop thefile_fakecontainerWhy?
See my question on v1.
The fake file objects are used both as vm_file and in read/write iter how do we know which path to use in low level functions?
If we allocate file_fake container and still store the fake path in f_path, then we have no need to store also the real path because ovl knows how to get from fake path to real path.
This is what v2 does.
What am I missing?
Thanks,
Amir.
Amir Goldstein
maintainerQuoted 26 lines · Amir Goldstein
Quoted 12 lines · Miklos Szeredi
Quoted 10 lines · Amir Goldstein
Miklos,
The first solution that we discussed for removing
FMODE_NONOTIFYfrom overlayfs real files usingfile_fakecontainer got complicated.This alternative solution is less intrusive to vfs and all the vfs code should remian unaffected expect for the special fsnotify case that we want to fix.
Quoted 7 lines
Quoted 5 lines
Thanks,
Amir.Changes since v1:
- Drop thefile_fakecontainerWhy?
See my question on v1.
The fake file objects are used both asvm_fileand in read/write iter how do we know which path to use in low level functions?
Quoted 8 lines
If we allocate
file_fakecontainer and still store the fake path inf_path, then we have no need to store also the real path because ovl knows how to get from fake path to real path.This is what v2 does.
What am I missing?
Is it because getting f_real_path() and file_dentry() via d_real() is more expensive?
and caching this information in file_fake container would be more efficient?
I will restore the file_fake container and post v3.
Thanks,
Amir.
Miklos Szeredi
maintainerQuoted 6 lines · Amir Goldstein
Is it because getting
f_real_path()andfile_dentry()viad_real()is more expensive?
and caching this information infile_fakecontainer would be more efficient?I will restore the
file_fakecontainer and post v3.
I simply dislike the fact that ->d_real() is getting more complex. I'd prefer d_real to die, which is unfortunately not so easy, as you've explained.
But if we can make it somewhat less complex (remove the inode parameter) instead of more complex (add a vfsmount * parameter) then that's already a big win in my eyes.
Thanks,
Miklos
Amir Goldstein
maintainerQuoted 10 lines · Miklos Szeredi
Quoted 6 lines · Amir Goldstein
Is it because getting
f_real_path()andfile_dentry()viad_real()is more expensive?
and caching this information infile_fakecontainer would be more efficient?I will restore the
file_fakecontainer and post v3.
Quoted 8 lines
I simply dislike the fact that ->d_real() is getting more complex. I'd prefer
d_realto die, which is unfortunately not so easy, as you've explained.But if we can make it somewhat less complex (remove the inode parameter) instead of more complex (add a vfsmount * parameter) then that's already a big win in my eyes.
OK, I can relate to that.
Here is file_fake restored, now with fsnotify fix also tested:
https://github.com/amir73il/linux/commits/ovl_fake_path
IIUC, you would now want to change file_dentry(f) to using f_real_file(f)->dentry and get rid of the inode argument to d_real().
Do you want that change also in v3 or should we save some fun for later and just fix fsnotify for now?
Thanks,
Amir.
Miklos Szeredi
maintainerQuoted 25 lines · Amir Goldstein
Quoted 10 lines · Miklos Szeredi
Quoted 6 lines · Amir Goldstein
Is it because getting
f_real_path()andfile_dentry()viad_real()is more expensive?
and caching this information infile_fakecontainer would be more efficient?I will restore the
file_fakecontainer and post v3.Quoted 8 lines
I simply dislike the fact that ->d_real() is getting more complex. I'd prefer
d_realto die, which is unfortunately not so easy, as you've explained.But if we can make it somewhat less complex (remove the inode parameter) instead of more complex (add a vfsmount * parameter) then that's already a big win in my eyes.
OK, I can relate to that.
Here is
file_fakerestored, now with fsnotify fix also tested:
Quoted 7 lines
https://github.com/amir73il/linux/commits/ovl_fake_path
IIUC, you would now want to change
file_dentry(f)to using f_real_file(f)->dentry and get rid of the inode argument tod_real().Do you want that change also in v3 or should we save some fun for later and just fix fsnotify for now?
Can do that later. Small steps are good.
Thanks,
Miklos