Re: [PATCH] ovl: make private mounts longterm

2020-05-22 Thread Miklos Szeredi
On Fri, May 22, 2020 at 9:56 PM Al Viro wrote: > > On Fri, May 22, 2020 at 08:53:49PM +0200, Miklos Szeredi wrote: > > Right, we should just get rid of ofs->upper_mnt and ofs->upperdir_trap > > and use ofs->layers[0] to store those. > > For that you'd need to allocate ->layers before you get to o

Re: [PATCH] ovl: make private mounts longterm

2020-05-22 Thread Al Viro
On Fri, May 22, 2020 at 08:53:49PM +0200, Miklos Szeredi wrote: > On Fri, May 22, 2020 at 7:02 PM Amir Goldstein wrote: > > > > > > > - mntput(ofs->upper_mnt); > > > > > - for (i = 1; i < ofs->numlayer; i++) { > > > > > - iput(ofs->layers[i].trap); > > > > > - mntpu

Re: [PATCH] ovl: make private mounts longterm

2020-05-22 Thread Miklos Szeredi
On Fri, May 22, 2020 at 7:02 PM Amir Goldstein wrote: > > > > > - mntput(ofs->upper_mnt); > > > > - for (i = 1; i < ofs->numlayer; i++) { > > > > - iput(ofs->layers[i].trap); > > > > - mntput(ofs->layers[i].mnt); > > > > + > > > > + if (!ofs->layers) { > > > > +

Re: [PATCH] ovl: make private mounts longterm

2020-05-22 Thread Amir Goldstein
> > > - mntput(ofs->upper_mnt); > > > - for (i = 1; i < ofs->numlayer; i++) { > > > - iput(ofs->layers[i].trap); > > > - mntput(ofs->layers[i].mnt); > > > + > > > + if (!ofs->layers) { > > > + /* Deal with partial setup */ > > > + kern_unm

Re: [PATCH] ovl: make private mounts longterm

2020-05-22 Thread Miklos Szeredi
On Fri, May 22, 2020 at 6:08 PM Al Viro wrote: > > On Fri, May 22, 2020 at 10:57:23AM +0200, Miklos Szeredi wrote: > > Overlayfs is using clone_private_mount() to create internal mounts for > > underlying layers. These are used for operations requiring a path, such as > > dentry_open(). > > > > S

Re: [PATCH] ovl: make private mounts longterm

2020-05-22 Thread Al Viro
On Fri, May 22, 2020 at 10:57:23AM +0200, Miklos Szeredi wrote: > Overlayfs is using clone_private_mount() to create internal mounts for > underlying layers. These are used for operations requiring a path, such as > dentry_open(). > > Since these private mounts are not in any namespace they are t

[PATCH] ovl: make private mounts longterm

2020-05-22 Thread Miklos Szeredi
Overlayfs is using clone_private_mount() to create internal mounts for underlying layers. These are used for operations requiring a path, such as dentry_open(). Since these private mounts are not in any namespace they are treated as short term, "detached" mounts and mntput() involves taking the g