[kbuild-all] [char-misc:char-misc-linus 5/6] drivers/android/binderfs.c:137: undefined reference to `init_ipc_ns'

kbuild test robot lkp at intel.com
Fri Jan 11 15:14:15 PST 2019


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git char-misc-linus
head:   411aba3c128fb4fd68b03e12a7ec6e7350d3b101
commit: 36bdf3cae09df891b191f3955c8e54a2e05d67d0 [5/6] binderfs: reserve devices for initial mount
config: x86_64-randconfig-u0-01120503 (attached as .config)
compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010
reproduce:
        git checkout 36bdf3cae09df891b191f3955c8e54a2e05d67d0
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   drivers/android/binderfs.o: In function `binderfs_binder_device_create':
>> drivers/android/binderfs.c:137: undefined reference to `init_ipc_ns'

vim +137 drivers/android/binderfs.c

   101	
   102	/**
   103	 * binderfs_binder_device_create - allocate inode from super block of a
   104	 *                                 binderfs mount
   105	 * @ref_inode: inode from wich the super block will be taken
   106	 * @userp:     buffer to copy information about new device for userspace to
   107	 * @req:       struct binderfs_device as copied from userspace
   108	 *
   109	 * This function allocated a new binder_device and reserves a new minor
   110	 * number for it.
   111	 * Minor numbers are limited and tracked globally in binderfs_minors. The
   112	 * function will stash a struct binder_device for the specific binder
   113	 * device in i_private of the inode.
   114	 * It will go on to allocate a new inode from the super block of the
   115	 * filesystem mount, stash a struct binder_device in its i_private field
   116	 * and attach a dentry to that inode.
   117	 *
   118	 * Return: 0 on success, negative errno on failure
   119	 */
   120	static int binderfs_binder_device_create(struct inode *ref_inode,
   121						 struct binderfs_device __user *userp,
   122						 struct binderfs_device *req)
   123	{
   124		int minor, ret;
   125		struct dentry *dentry, *dup, *root;
   126		struct binder_device *device;
   127		size_t name_len = BINDERFS_MAX_NAME + 1;
   128		char *name = NULL;
   129		struct inode *inode = NULL;
   130		struct super_block *sb = ref_inode->i_sb;
   131		struct binderfs_info *info = sb->s_fs_info;
   132		bool use_reserve = (info->ipc_ns == &init_ipc_ns);
   133	
   134		/* Reserve new minor number for the new device. */
   135		mutex_lock(&binderfs_minors_mutex);
   136		if (++info->device_count <= info->mount_opts.max)
 > 137			minor = ida_alloc_max(&binderfs_minors,
   138					      use_reserve ? BINDERFS_MAX_MINOR :
   139							    BINDERFS_MAX_MINOR_CAPPED,
   140					      GFP_KERNEL);
   141		else
   142			minor = -ENOSPC;
   143		if (minor < 0) {
   144			--info->device_count;
   145			mutex_unlock(&binderfs_minors_mutex);
   146			return minor;
   147		}
   148		mutex_unlock(&binderfs_minors_mutex);
   149	
   150		ret = -ENOMEM;
   151		device = kzalloc(sizeof(*device), GFP_KERNEL);
   152		if (!device)
   153			goto err;
   154	
   155		inode = new_inode(sb);
   156		if (!inode)
   157			goto err;
   158	
   159		inode->i_ino = minor + INODE_OFFSET;
   160		inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
   161		init_special_inode(inode, S_IFCHR | 0600,
   162				   MKDEV(MAJOR(binderfs_dev), minor));
   163		inode->i_fop = &binder_fops;
   164		inode->i_uid = info->root_uid;
   165		inode->i_gid = info->root_gid;
   166	
   167		name = kmalloc(name_len, GFP_KERNEL);
   168		if (!name)
   169			goto err;
   170	
   171		strscpy(name, req->name, name_len);
   172	
   173		device->binderfs_inode = inode;
   174		device->context.binder_context_mgr_uid = INVALID_UID;
   175		device->context.name = name;
   176		device->miscdev.name = name;
   177		device->miscdev.minor = minor;
   178		mutex_init(&device->context.context_mgr_node_lock);
   179	
   180		req->major = MAJOR(binderfs_dev);
   181		req->minor = minor;
   182	
   183		ret = copy_to_user(userp, req, sizeof(*req));
   184		if (ret) {
   185			ret = -EFAULT;
   186			goto err;
   187		}
   188	
   189		root = sb->s_root;
   190		inode_lock(d_inode(root));
   191		dentry = d_alloc_name(root, name);
   192		if (!dentry) {
   193			inode_unlock(d_inode(root));
   194			ret = -ENOMEM;
   195			goto err;
   196		}
   197	
   198		/* Verify that the name userspace gave us is not already in use. */
   199		dup = d_lookup(root, &dentry->d_name);
   200		if (dup) {
   201			if (d_really_is_positive(dup)) {
   202				dput(dup);
   203				dput(dentry);
   204				inode_unlock(d_inode(root));
   205				ret = -EEXIST;
   206				goto err;
   207			}
   208			dput(dup);
   209		}
   210	
   211		inode->i_private = device;
   212		d_add(dentry, inode);
   213		fsnotify_create(root->d_inode, dentry);
   214		inode_unlock(d_inode(root));
   215	
   216		return 0;
   217	
   218	err:
   219		kfree(name);
   220		kfree(device);
   221		mutex_lock(&binderfs_minors_mutex);
   222		--info->device_count;
   223		ida_free(&binderfs_minors, minor);
   224		mutex_unlock(&binderfs_minors_mutex);
   225		iput(inode);
   226	
   227		return ret;
   228	}
   229	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 36336 bytes
Desc: not available
URL: <http://lists.01.org/pipermail/kbuild-all/attachments/20190112/1a894962/attachment-0001.bin>


More information about the kbuild-all mailing list