summaryrefslogtreecommitdiffstats
path: root/drivers/android/binderfs.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-02-11 03:25:01 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-02-11 03:25:01 -0500
commit3b6effbc3805a4fd282549d6283f115c47b12a7e (patch)
treed7c7f818ffa5797c648ce3ea8b985b515e9ff816 /drivers/android/binderfs.c
parentc2f4dd4364b71ef4eb43925b402377aefe9c1ca0 (diff)
parentd13937116f1e82bf508a6325111b322c30c85eb9 (diff)
Merge 5.0-rc6 into staging-next
We need the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/android/binderfs.c')
-rw-r--r--drivers/android/binderfs.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c
index 6a2185eb66c5..e773f45d19d9 100644
--- a/drivers/android/binderfs.c
+++ b/drivers/android/binderfs.c
@@ -395,6 +395,11 @@ static int binderfs_binder_ctl_create(struct super_block *sb)
395 struct inode *inode = NULL; 395 struct inode *inode = NULL;
396 struct dentry *root = sb->s_root; 396 struct dentry *root = sb->s_root;
397 struct binderfs_info *info = sb->s_fs_info; 397 struct binderfs_info *info = sb->s_fs_info;
398#if defined(CONFIG_IPC_NS)
399 bool use_reserve = (info->ipc_ns == &init_ipc_ns);
400#else
401 bool use_reserve = true;
402#endif
398 403
399 device = kzalloc(sizeof(*device), GFP_KERNEL); 404 device = kzalloc(sizeof(*device), GFP_KERNEL);
400 if (!device) 405 if (!device)
@@ -413,7 +418,10 @@ static int binderfs_binder_ctl_create(struct super_block *sb)
413 418
414 /* Reserve a new minor number for the new device. */ 419 /* Reserve a new minor number for the new device. */
415 mutex_lock(&binderfs_minors_mutex); 420 mutex_lock(&binderfs_minors_mutex);
416 minor = ida_alloc_max(&binderfs_minors, BINDERFS_MAX_MINOR, GFP_KERNEL); 421 minor = ida_alloc_max(&binderfs_minors,
422 use_reserve ? BINDERFS_MAX_MINOR :
423 BINDERFS_MAX_MINOR_CAPPED,
424 GFP_KERNEL);
417 mutex_unlock(&binderfs_minors_mutex); 425 mutex_unlock(&binderfs_minors_mutex);
418 if (minor < 0) { 426 if (minor < 0) {
419 ret = minor; 427 ret = minor;
@@ -542,7 +550,7 @@ static struct file_system_type binder_fs_type = {
542 .fs_flags = FS_USERNS_MOUNT, 550 .fs_flags = FS_USERNS_MOUNT,
543}; 551};
544 552
545static int __init init_binderfs(void) 553int __init init_binderfs(void)
546{ 554{
547 int ret; 555 int ret;
548 556
@@ -560,5 +568,3 @@ static int __init init_binderfs(void)
560 568
561 return ret; 569 return ret;
562} 570}
563
564device_initcall(init_binderfs);