Re: [PATCH v11 11/18] ovl: Allocate bigger stack for origin

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

 



On Thu, Feb 01, 2018 at 02:07:07AM +0200, Amir Goldstein wrote:
> On Wed, Jan 31, 2018 at 11:13 PM, Vivek Goyal <vgoyal@xxxxxxxxxx> wrote:
> > Right now there is only one origin for upper dentry and we allocate space
> > to hold only one ovl_path. But with metacopy support, it is possible that
> > lower origin is a metacopy itself and we will continue the search for
> > lower most data entry and install that too in lower stack so that this
> > entry can be used for copy up later.
> >
> > Signed-off-by: Vivek Goyal <vgoyal@xxxxxxxxxx>
> > ---
> >  fs/overlayfs/namei.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
> > index 27a069cd2bf4..ddb73b5a06d4 100644
> > --- a/fs/overlayfs/namei.c
> > +++ b/fs/overlayfs/namei.c
> > @@ -361,7 +361,8 @@ static int ovl_check_origin(struct dentry *upperdentry,
> >
> >         BUG_ON(*ctrp);
> >         if (!*stackp)
> > -               *stackp = kmalloc(sizeof(struct ovl_path), GFP_KERNEL);
> > +               *stackp = kmalloc(sizeof(struct ovl_path) * numlower,
> > +                                 GFP_KERNEL);
> 
> I guess you forgot to change that size to 2...

I intentionally kept it at numlower because that's what we are doing for
lower as well. And that keeps it common between two. Anyway, this
allocation is only temporary as we will allocate new memory and copy 
everything there. So I was not worried about temporary allocating numlower
elements instead of hardcoding it to 2.

Vivek

> 
> Amir.
--
To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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