public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][RFC] rust_binderfs: fix a dentry leak (regression from tree-in-dcache conversion)
@ 2026-02-05  7:43 Al Viro
  2026-02-05  8:02 ` Greg Kroah-Hartman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Al Viro @ 2026-02-05  7:43 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Alice Ryhl, Greg Kroah-Hartman

[just realized that this one had been sitting in #fixes without being
posted - sorry]

Parallel to binderfs patches - 02da8d2c0965 "binderfs_binder_ctl_create():
kill a bogus check" and the bit of b89aa544821d "convert binderfs" that
got lost when making 4433d8e25d73 "convert rust_binderfs"; the former is
a cleanup, the latter is about marking /binder-control persistent, so that
it would be taken out on umount.

Fixes: 4433d8e25d73 ("convert rust_binderfs")
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 drivers/android/binder/rust_binderfs.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/android/binder/rust_binderfs.c b/drivers/android/binder/rust_binderfs.c
index c69026df775c..e36011e89116 100644
--- a/drivers/android/binder/rust_binderfs.c
+++ b/drivers/android/binder/rust_binderfs.c
@@ -391,12 +391,6 @@ static int binderfs_binder_ctl_create(struct super_block *sb)
 	if (!device)
 		return -ENOMEM;
 
-	/* If we have already created a binder-control node, return. */
-	if (info->control_dentry) {
-		ret = 0;
-		goto out;
-	}
-
 	ret = -ENOMEM;
 	inode = new_inode(sb);
 	if (!inode)
@@ -431,7 +425,8 @@ static int binderfs_binder_ctl_create(struct super_block *sb)
 
 	inode->i_private = device;
 	info->control_dentry = dentry;
-	d_add(dentry, inode);
+	d_make_persistent(dentry, inode);
+	dput(dentry);
 
 	return 0;
 
-- 
2.47.3


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

* Re: [PATCH][RFC] rust_binderfs: fix a dentry leak (regression from tree-in-dcache conversion)
  2026-02-05  7:43 [PATCH][RFC] rust_binderfs: fix a dentry leak (regression from tree-in-dcache conversion) Al Viro
@ 2026-02-05  8:02 ` Greg Kroah-Hartman
  2026-02-05  8:08 ` Alice Ryhl
  2026-02-05  8:27 ` Christian Brauner
  2 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2026-02-05  8:02 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-fsdevel, Alice Ryhl

On Thu, Feb 05, 2026 at 07:43:42AM +0000, Al Viro wrote:
> [just realized that this one had been sitting in #fixes without being
> posted - sorry]
> 
> Parallel to binderfs patches - 02da8d2c0965 "binderfs_binder_ctl_create():
> kill a bogus check" and the bit of b89aa544821d "convert binderfs" that
> got lost when making 4433d8e25d73 "convert rust_binderfs"; the former is
> a cleanup, the latter is about marking /binder-control persistent, so that
> it would be taken out on umount.
> 
> Fixes: 4433d8e25d73 ("convert rust_binderfs")
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---
>  drivers/android/binder/rust_binderfs.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/android/binder/rust_binderfs.c b/drivers/android/binder/rust_binderfs.c
> index c69026df775c..e36011e89116 100644
> --- a/drivers/android/binder/rust_binderfs.c
> +++ b/drivers/android/binder/rust_binderfs.c
> @@ -391,12 +391,6 @@ static int binderfs_binder_ctl_create(struct super_block *sb)
>  	if (!device)
>  		return -ENOMEM;
>  
> -	/* If we have already created a binder-control node, return. */
> -	if (info->control_dentry) {
> -		ret = 0;
> -		goto out;
> -	}
> -
>  	ret = -ENOMEM;
>  	inode = new_inode(sb);
>  	if (!inode)
> @@ -431,7 +425,8 @@ static int binderfs_binder_ctl_create(struct super_block *sb)
>  
>  	inode->i_private = device;
>  	info->control_dentry = dentry;
> -	d_add(dentry, inode);
> +	d_make_persistent(dentry, inode);
> +	dput(dentry);
>  
>  	return 0;
>  
> -- 
> 2.47.3
> 

Nice!  Want me to take this in my tree, or are you going to send this to
Linus before -final happens?

thanks,

greg k-h

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

* Re: [PATCH][RFC] rust_binderfs: fix a dentry leak (regression from tree-in-dcache conversion)
  2026-02-05  7:43 [PATCH][RFC] rust_binderfs: fix a dentry leak (regression from tree-in-dcache conversion) Al Viro
  2026-02-05  8:02 ` Greg Kroah-Hartman
@ 2026-02-05  8:08 ` Alice Ryhl
  2026-02-05  8:27 ` Christian Brauner
  2 siblings, 0 replies; 4+ messages in thread
From: Alice Ryhl @ 2026-02-05  8:08 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-fsdevel, Greg Kroah-Hartman

On Thu, Feb 5, 2026 at 8:41 AM Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> [just realized that this one had been sitting in #fixes without being
> posted - sorry]
>
> Parallel to binderfs patches - 02da8d2c0965 "binderfs_binder_ctl_create():
> kill a bogus check" and the bit of b89aa544821d "convert binderfs" that
> got lost when making 4433d8e25d73 "convert rust_binderfs"; the former is
> a cleanup, the latter is about marking /binder-control persistent, so that
> it would be taken out on umount.
>
> Fixes: 4433d8e25d73 ("convert rust_binderfs")
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Acked-by: Alice Ryhl <aliceryhl@google.com>

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

* Re: [PATCH][RFC] rust_binderfs: fix a dentry leak (regression from tree-in-dcache conversion)
  2026-02-05  7:43 [PATCH][RFC] rust_binderfs: fix a dentry leak (regression from tree-in-dcache conversion) Al Viro
  2026-02-05  8:02 ` Greg Kroah-Hartman
  2026-02-05  8:08 ` Alice Ryhl
@ 2026-02-05  8:27 ` Christian Brauner
  2 siblings, 0 replies; 4+ messages in thread
From: Christian Brauner @ 2026-02-05  8:27 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-fsdevel, Alice Ryhl, Greg Kroah-Hartman

On Thu, Feb 05, 2026 at 07:43:42AM +0000, Al Viro wrote:
> [just realized that this one had been sitting in #fixes without being
> posted - sorry]
> 
> Parallel to binderfs patches - 02da8d2c0965 "binderfs_binder_ctl_create():
> kill a bogus check" and the bit of b89aa544821d "convert binderfs" that
> got lost when making 4433d8e25d73 "convert rust_binderfs"; the former is
> a cleanup, the latter is about marking /binder-control persistent, so that
> it would be taken out on umount.
> 
> Fixes: 4433d8e25d73 ("convert rust_binderfs")
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---
>  drivers/android/binder/rust_binderfs.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/android/binder/rust_binderfs.c b/drivers/android/binder/rust_binderfs.c
> index c69026df775c..e36011e89116 100644
> --- a/drivers/android/binder/rust_binderfs.c
> +++ b/drivers/android/binder/rust_binderfs.c
> @@ -391,12 +391,6 @@ static int binderfs_binder_ctl_create(struct super_block *sb)
>  	if (!device)
>  		return -ENOMEM;
>  
> -	/* If we have already created a binder-control node, return. */
> -	if (info->control_dentry) {
> -		ret = 0;
> -		goto out;
> -	}

I thought at some point this was supposed to have a second callpath
which is probably why that check existed. Anyway, thanks for the
cleanup,

Acked-by: Christian Brauner <brauner@kernel.org>

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

end of thread, other threads:[~2026-02-05  8:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-05  7:43 [PATCH][RFC] rust_binderfs: fix a dentry leak (regression from tree-in-dcache conversion) Al Viro
2026-02-05  8:02 ` Greg Kroah-Hartman
2026-02-05  8:08 ` Alice Ryhl
2026-02-05  8:27 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox