Re: [PATCH v2 00/13] Overlayfs lazy lookup of lowerdata

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 9, 2023 at 4:52 PM Miklos Szeredi <miklos@xxxxxxxxxx> wrote:
>
> On Fri, 9 Jun 2023 at 15:42, Amir Goldstein <amir73il@xxxxxxxxx> wrote:
>
> > Miklos,
> >
> > I see you pushed the branch as is.
> >
> > Please be warned that it contains the following unexplained
> > merge commit:
> >
> > commit b892fac09d57668181ff5c433958e96ec7755453
> > Merge: f1fcbaa18b28 7cdafe6cc4a6
> > Author: Amir Goldstein <amir73il@xxxxxxxxx>
> > Date:   Thu May 25 15:14:13 2023 +0300
> >
> >     Merge remote-tracking branch 'jack/fsnotify' into next
> >
> > And you know how Linus hates unexplained merge commits.
> >
> > In this case, it is unexplained and also does not have a
> > good reason in the context of an ovl pull request.
>
> Yes, I will redo this, but for getting into -next this will do.
>

Miklos,

I found a memory leak in these patches (reported by kmemleak).
For negative dentries, oe was allocated but not stored and not
freed.

Below is diff -w of the fix.
I squashed this fix into:
"ovl: move ovl_entry into ovl_inode"
and pushed the fixed overlayfs-next to my github [1]
I've also reabsed overlayfs-next onto 6.4-rc6.

Let me know if you want me to ask Steven to pull the fixed
branch into linux-next.

Thanks,
Amir.

[1] https://github.com/amir73il/linux/commits/fs-overlayfs-mount_api

--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -938,7 +938,7 @@ int ovl_maybe_lookup_lowerdata(struct dentry *dentry)
 struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
                          unsigned int flags)
 {
-       struct ovl_entry *oe;
+       struct ovl_entry *oe = NULL;
        const struct cred *old_cred;
        struct ovl_fs *ofs = dentry->d_sb->s_fs_info;
        struct ovl_entry *poe = OVL_E(dentry->d_parent);
@@ -1180,12 +1180,14 @@ struct dentry *ovl_lookup(struct inode *dir,
struct dentry *dentry,
                }
        }

+       if (ctr) {
                oe = ovl_alloc_entry(ctr);
                err = -ENOMEM;
                if (!oe)
                        goto out_put;

                ovl_stack_cpy(ovl_lowerstack(oe), stack, ctr);
+       }




[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux