linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] vfs: ro-bind: fix leaking refcounts in setxattr
@ 2008-04-02 18:01 Miklos Szeredi
  2008-04-02 18:26 ` Dave Hansen
  0 siblings, 1 reply; 2+ messages in thread
From: Miklos Szeredi @ 2008-04-02 18:01 UTC (permalink / raw)
  To: haveblue; +Cc: viro, linux-fsdevel, linux-kernel

From: Miklos Szeredi <mszeredi@suse.cz>

setxattr() and lsetxattr() were leaking mount/dentry references on
read-only mount.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---
 fs/xattr.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: vfs-2.6/fs/xattr.c
===================================================================
--- vfs-2.6.orig/fs/xattr.c	2008-04-02 19:53:18.000000000 +0200
+++ vfs-2.6/fs/xattr.c	2008-04-02 19:54:53.000000000 +0200
@@ -263,9 +263,10 @@ sys_setxattr(char __user *path, char __u
 		return error;
 	error = mnt_want_write(nd.path.mnt);
 	if (error)
-		return error;
+		goto out_path_put;
 	error = setxattr(nd.path.dentry, name, value, size, flags);
 	mnt_drop_write(nd.path.mnt);
+ out_path_put:
 	path_put(&nd.path);
 	return error;
 }
@@ -282,9 +283,10 @@ sys_lsetxattr(char __user *path, char __
 		return error;
 	error = mnt_want_write(nd.path.mnt);
 	if (error)
-		return error;
+		goto out_path_put;
 	error = setxattr(nd.path.dentry, name, value, size, flags);
 	mnt_drop_write(nd.path.mnt);
+ out_path_put:
 	path_put(&nd.path);
 	return error;
 }

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

* Re: [patch] vfs: ro-bind: fix leaking refcounts in setxattr
  2008-04-02 18:01 [patch] vfs: ro-bind: fix leaking refcounts in setxattr Miklos Szeredi
@ 2008-04-02 18:26 ` Dave Hansen
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Hansen @ 2008-04-02 18:26 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: viro, linux-fsdevel, linux-kernel

On Wed, 2008-04-02 at 20:01 +0200, Miklos Szeredi wrote:
> From: Miklos Szeredi <mszeredi@suse.cz>
> 
> setxattr() and lsetxattr() were leaking mount/dentry references on
> read-only mount.

Obviously correct now that I go look at it.  Thanks, Miklos.

Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>

-- Dave


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

end of thread, other threads:[~2008-04-02 18:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-02 18:01 [patch] vfs: ro-bind: fix leaking refcounts in setxattr Miklos Szeredi
2008-04-02 18:26 ` Dave Hansen

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).