Re: [PATCH] Fix mountpoint reference leakage in linkat

2014-01-31 Thread Jeff Layton
On Fri, 31 Jan 2014 22:30:14 + Al Viro wrote: > On Fri, Jan 31, 2014 at 04:32:31PM -0500, Jeff Layton wrote: > > > done_path_create(&new_path, new_dentry); > > + path_put(&old_path); > > ... and the filesystem in question isn't pinned anymore, so it can be > unmounted, except that >

Re: [PATCH] Fix mountpoint reference leakage in linkat

2014-01-31 Thread Al Viro
On Fri, Jan 31, 2014 at 04:32:31PM -0500, Jeff Layton wrote: > done_path_create(&new_path, new_dentry); > + path_put(&old_path); ... and the filesystem in question isn't pinned anymore, so it can be unmounted, except that > if (delegated_inode) { > error = break_del

Re: [PATCH] Fix mountpoint reference leakage in linkat

2014-01-31 Thread Oleg Drokin
> Maybe something like this (untested) instead? I think it's just safe to move the out label up along with the old_path freeing. In all error cases the retry and delegation breaking logic could not be triggered anyway. Something like this (lightly tested): 0001-vfs-Fix-mountpoint-reference-l

Re: [PATCH] Fix mountpoint reference leakage in linkat

2014-01-31 Thread Jeff Layton
On Fri, 31 Jan 2014 16:13:19 -0500 Oleg Drokin wrote: > > On Jan 31, 2014, at 4:03 PM, Al Viro wrote: > >> diff --git a/fs/namei.c b/fs/namei.c > >> index bcb838e..e620937 100644 > >> --- a/fs/namei.c > >> +++ b/fs/namei.c > >> @@ -3931,6 +3931,7 @@ out_dput: > >>goto retry;

Re: [PATCH] Fix mountpoint reference leakage in linkat

2014-01-31 Thread Oleg Drokin
On Jan 31, 2014, at 4:03 PM, Al Viro wrote: >> diff --git a/fs/namei.c b/fs/namei.c >> index bcb838e..e620937 100644 >> --- a/fs/namei.c >> +++ b/fs/namei.c >> @@ -3931,6 +3931,7 @@ out_dput: >> goto retry; >> } >> if (retry_estale(error, how)) { >> +path

Re: [PATCH] Fix mountpoint reference leakage in linkat

2014-01-31 Thread Al Viro
On Fri, Jan 31, 2014 at 03:41:58PM -0500, Oleg Drokin wrote: > Recent changes to retry on ESTALE in linkat > (commit 442e31ca5a49e398351b2954b51f578353fdf210) > introduced a mountpoint reference leak and a small memory > leak in case a filesystem link operation returns ESTALE > which is pretty norm

Re: [PATCH] Fix mountpoint reference leakage in linkat

2014-01-31 Thread Jeff Layton
On Fri, 31 Jan 2014 15:41:58 -0500 Oleg Drokin wrote: > Recent changes to retry on ESTALE in linkat > (commit 442e31ca5a49e398351b2954b51f578353fdf210) > introduced a mountpoint reference leak and a small memory > leak in case a filesystem link operation returns ESTALE > which is pretty normal fo

[PATCH] Fix mountpoint reference leakage in linkat

2014-01-31 Thread Oleg Drokin
Recent changes to retry on ESTALE in linkat (commit 442e31ca5a49e398351b2954b51f578353fdf210) introduced a mountpoint reference leak and a small memory leak in case a filesystem link operation returns ESTALE which is pretty normal for distributed filesystems like lustre, nfs and so on. Free old_pat