rust_binderfs: fix a dentry leak (regression from tree-in-dcache conversion)
Subsystems (2)
Al Viro
maintainerRFC PATCH 1/1 rust_binderfs: fix a dentry leak (regression from tree-in-dcache conversion)
[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.
--- drivers/android/binder/rust_binderfs.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/android/binder/rust_binderfs.c +2 -7
@@ -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 ;
Signature · 1 line
2.47.3
Greg Kroah-Hartman
maintainerQuoted 45 lines · Al Viro
[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 ofb89aa544821d"convert binderfs" that got lost when making4433d8e25d73"convertrust_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 <[email protected]>--- drivers/android/binder/rust_binderfs.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)drivers/android/binder/rust_binderfs.c +2
-7@@ -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 ;Signature · 1 line
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
Quoted 4 lines · Al Viro
[just realized that this one had been sitting in #fixes without being posted - sorry]
Quoted 8 lines
Parallel to binderfs patches -
02da8d2c0965"binderfs_binder_ctl_create():
kill a bogus check" and the bit ofb89aa544821d"convert binderfs" that got lost when making4433d8e25d73"convertrust_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 <[email protected]>
Quoted 20 lines · Al Viro
[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 ofb89aa544821d"convert binderfs" that got lost when making4433d8e25d73"convertrust_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 <[email protected]>--- drivers/android/binder/rust_binderfs.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)drivers/android/binder/rust_binderfs.c +0
-0
drivers/android/binder/rust_binderfs.c static int binderfs_binder_ctl_create(struct super_block *sb) · line 398
Quoted 8 lines
drivers/android/binder/rust_binderfs.c +0
-5@@ -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,