linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix mountpoint reference leakage in linkat
@ 2014-01-31 20:41 Oleg Drokin
  2014-01-31 20:52 ` Jeff Layton
  2014-01-31 21:03 ` Al Viro
  0 siblings, 2 replies; 9+ messages in thread
From: Oleg Drokin @ 2014-01-31 20:41 UTC (permalink / raw)
  To: linux-kernel, jlayton, viro, linux-fsdevel; +Cc: 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_path in such a case.

Signed-off-by: Oleg Drokin: <green@linuxhacker.ru>
---
 fs/namei.c | 1 +
 1 file changed, 1 insertion(+)

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_put(&old_path);
 		how |= LOOKUP_REVAL;
 		goto retry;
 	}
-- 
1.8.5.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-01-31 23:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-31 20:41 [PATCH] Fix mountpoint reference leakage in linkat Oleg Drokin
2014-01-31 20:52 ` Jeff Layton
2014-01-31 21:03 ` Al Viro
2014-01-31 21:13   ` Oleg Drokin
2014-01-31 21:32     ` Jeff Layton
2014-01-31 21:50       ` Oleg Drokin
2014-01-31 22:30       ` Al Viro
2014-01-31 22:34         ` [PATCH v2] vfs: " Oleg Drokin
2014-01-31 23:11         ` [PATCH] " Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).