All of lore.kernel.org
 help / color / mirror / Atom feed
* [rw-misc:muse-wip 8/9] drivers/mtd/muse.c:892:16: error: implicit declaration of function 'task_tgid_vnr'
@ 2026-11-29  1:40 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-11-29  1:40 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rw/misc.git muse-wip
head:   77047033a75a5bf807b2376d08edd9ce12ed67ec
commit: c1a3aa10457c384873e85a0f50cb8a5065689c3a [8/9] mtd: Implement MUSE - MTD in userspace
config: alpha-randconfig-2001-20261129 (https://download.01.org/0day-ci/archive/20261129/20261129023420.FCFh8lbF-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 10.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261129/20261129023420.FCFh8lbF-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261129023420.FCFh8lbF-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/mtd/muse.c: In function 'muse_process_init_reply':
>> drivers/mtd/muse.c:892:16: error: implicit declaration of function 'task_tgid_vnr' [-Werror=implicit-function-declaration]
     892 |  mc->creator = task_tgid_vnr(current);
         |                ^~~~~~~~~~~~~
   drivers/mtd/muse.c: In function 'muse_ctrl_open':
>> drivers/mtd/muse.c:972:7: error: implicit declaration of function 'capable' [-Werror=implicit-function-declaration]
     972 |  if (!capable(CAP_SYS_ADMIN))
         |       ^~~~~~~
>> drivers/mtd/muse.c:972:15: error: 'CAP_SYS_ADMIN' undeclared (first use in this function)
     972 |  if (!capable(CAP_SYS_ADMIN))
         |               ^~~~~~~~~~~~~
   drivers/mtd/muse.c:972:15: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/mtd/muse.c:1001:6: error: invalid use of undefined type 'struct file'
    1001 |  file->private_data = fud;
         |      ^~
   drivers/mtd/muse.c: In function 'muse_init':
>> drivers/mtd/muse.c:1049:19: error: 'fuse_dev_operations' has an incomplete type 'const struct file_operations'
    1049 |  muse_ctrl_fops = fuse_dev_operations;
         |                   ^~~~~~~~~~~~~~~~~~~
>> drivers/mtd/muse.c:1049:17: error: 'muse_ctrl_fops' has an incomplete type 'struct file_operations'
    1049 |  muse_ctrl_fops = fuse_dev_operations;
         |                 ^
>> drivers/mtd/muse.c:1050:16: error: invalid use of undefined type 'struct file_operations'
    1050 |  muse_ctrl_fops.owner = THIS_MODULE;
         |                ^
   drivers/mtd/muse.c:1051:16: error: invalid use of undefined type 'struct file_operations'
    1051 |  muse_ctrl_fops.open = muse_ctrl_open;
         |                ^
   drivers/mtd/muse.c:1052:16: error: invalid use of undefined type 'struct file_operations'
    1052 |  muse_ctrl_fops.release = muse_ctrl_release;
         |                ^
   drivers/mtd/muse.c:1054:16: error: invalid use of undefined type 'struct file_operations'
    1054 |  muse_ctrl_fops.unlocked_ioctl = NULL;
         |                ^
   drivers/mtd/muse.c: At top level:
>> drivers/mtd/muse.c:1036:31: error: storage size of 'muse_ctrl_fops' isn't known
    1036 | static struct file_operations muse_ctrl_fops;
         |                               ^~~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +/task_tgid_vnr +892 drivers/mtd/muse.c

   836	
   837	static void muse_process_init_reply(struct fuse_args *args, int error)
   838	{
   839		struct muse_init_args *mia = container_of(args, struct muse_init_args, args);
   840		struct muse_conn *mc = mia->mc;
   841		struct muse_init_out *arg = &mia->out;
   842		struct mtd_info *mtd = &mc->mtd;
   843		struct muse_mtd_init_ctx *init_ctx = NULL;
   844		int ret;
   845	
   846		init_ctx = kzalloc(sizeof(*init_ctx), GFP_KERNEL);
   847		if (!init_ctx)
   848			goto abort;
   849	
   850		init_ctx->mc = mc;
   851	
   852		if (error || arg->fuse_major != FUSE_KERNEL_VERSION || arg->fuse_minor < 48)
   853			goto free_ctx;
   854	
   855		mc->max_read = max_t(unsigned int, arg->max_read, 4096);
   856		mc->max_write = max_t(unsigned int, arg->max_write, 4096);
   857	
   858		ret = muse_parse_mtdreq(mia->info, args->out_args[1].size, mtd,
   859					&init_ctx->pd);
   860		if (ret)
   861			goto free_ctx;
   862	
   863		mtd->_erase = muse_mtd_erase;
   864		mtd->_sync = muse_mtd_sync;
   865		mtd->_read_oob = muse_mtd_read_oob;
   866		mtd->_write_oob = muse_mtd_write_oob;
   867		mtd->_get_device = muse_mtd_get_device;
   868		mtd->_put_device = muse_mtd_put_device;
   869	
   870		/*
   871		 * Bad blocks make only sense on NAND devices.
   872		 * As soon _block_isbad is set, upper layer such as
   873		 * UBI expects a working _block_isbad, so userspace
   874		 * has to implement MUSE_ISBAD.
   875		 */
   876		if (mtd_type_is_nand(mtd)) {
   877			mtd->_block_isbad = muse_mtd_isbad;
   878			mtd->_block_markbad = muse_mtd_markbad;
   879		}
   880	
   881		mtd->priv = mc;
   882		mtd->owner = THIS_MODULE;
   883	
   884		/*
   885		 * We want one READ/WRITE op per MTD io. So the MTD pagesize plus
   886		 * the out-of-band area needs to fit into max_write/max_read
   887		 */
   888		if (mc->max_write < mtd->writebufsize + mtd->oobsize ||
   889		    mc->max_read < mtd->writebufsize + mtd->oobsize)
   890			goto free_name;
   891	
 > 892		mc->creator = task_tgid_vnr(current);
   893	
   894		kfree(mia->info);
   895		kfree(mia);
   896	
   897		INIT_WORK(&init_ctx->mtd_init_work, muse_init_mtd_work);
   898	
   899		/*
   900		 * MTD can access the device while probing it.
   901		 * e.g. scanning for bad blocks or custom partition parsers.
   902		 * So we need to do the final step in a different process
   903		 * context. Otherwise we will lockup here if the userspace
   904		 * side of this MUSE MTD is single threaded.
   905		 */
   906		schedule_work(&init_ctx->mtd_init_work);
   907		return;
   908	
   909	free_name:
   910		kfree(mtd->name);
   911	free_ctx:
   912		kfree(init_ctx);
   913	abort:
   914		kfree(mia->info);
   915		kfree(mia);
   916		fuse_conn_abort(mc->fc);
   917	}
   918	
   919	static int muse_send_init(struct muse_conn *mc)
   920	{
   921		struct muse_init_args *mia;
   922		struct fuse_args *args;
   923		int ret = -ENOMEM;
   924	
   925		mia = kzalloc(sizeof(*mia), GFP_KERNEL);
   926		if (!mia)
   927			goto err;
   928	
   929		mia->info = kzalloc(MUSE_INIT_INFO_MAX, GFP_KERNEL);
   930		if (!mia->info)
   931			goto err_mia;
   932	
   933		args = &mia->args;
   934		mia->mc = mc;
   935		mia->in.fuse_major = FUSE_KERNEL_VERSION;
   936		mia->in.fuse_minor = FUSE_KERNEL_MINOR_VERSION;
   937		args->opcode = MUSE_INIT;
   938		args->in_numargs = 1;
   939		args->in_args[0].size = sizeof(mia->in);
   940		args->in_args[0].value = &mia->in;
   941		args->out_numargs = 2;
   942		args->out_args[0].size = sizeof(mia->out);
   943		args->out_args[0].value = &mia->out;
   944		args->out_args[1].size = MUSE_INIT_INFO_MAX;
   945		args->out_args[1].value = mia->info;
   946		args->out_argvar = true;
   947		args->end = muse_process_init_reply;
   948	
   949		ret = fuse_conn_send_bg(mc->fc, args, GFP_KERNEL);
   950		if (ret)
   951			goto err_info;
   952	
   953		return 0;
   954	
   955	err_info:
   956		kfree(mia->info);
   957	err_mia:
   958		kfree(mia);
   959	err:
   960		return ret;
   961	}
   962	
   963	static int muse_ctrl_open(struct inode *inode, struct file *file)
   964	{
   965		struct muse_conn *mc;
   966		struct fuse_dev *fud;
   967		int ret;
   968	
   969		/*
   970		 * Paranoia check.
   971		 */
 > 972		if (!capable(CAP_SYS_ADMIN))
   973			return -EPERM;
   974	
   975		mc = kzalloc(sizeof(*mc), GFP_KERNEL);
   976		if (!mc)
   977			return -ENOMEM;
   978	
   979		mutex_init(&mc->ref_mutex);
   980	
   981		mc->fc = fuse_conn_new_dev(&init_user_ns, muse_conn_release, mc);
   982		if (!mc->fc) {
   983			kfree(mc);
   984			return -ENOMEM;
   985		}
   986	
   987		/*
   988		 * From now on mc is freed via muse_conn_release() as soon the last
   989		 * reference on the connection is gone.
   990		 */
   991		fud = fuse_conn_install_dev(mc->fc);
   992		if (!fud) {
   993			ret = -ENOMEM;
   994			goto err_conn;
   995		}
   996	
   997		ret = muse_send_init(mc);
   998		if (ret)
   999			goto err_dev;
  1000	
> 1001		file->private_data = fud;
  1002	
  1003		return 0;
  1004	
  1005	err_dev:
  1006		fuse_dev_put(fud);
  1007	err_conn:
  1008		fuse_conn_put(mc->fc);
  1009		return ret;
  1010	}
  1011	
  1012	static int muse_ctrl_release(struct inode *inode, struct file *file)
  1013	{
  1014		struct muse_conn *mc = fuse_conn_priv(fuse_conn_from_file(file));
  1015	
  1016		mutex_lock(&mc->ref_mutex);
  1017		/*
  1018		 * Make sure that nobody can gain a new reference on our MTD.
  1019		 */
  1020		mc->want_exit = true;
  1021	
  1022		/*
  1023		 * If the MTD has no users, remove it right now, keep it otherwise
  1024		 * until the last user is gone. During this phase all operations will
  1025		 * fail with -ENOTCONN.
  1026		 */
  1027		if (mc->mtd_users == 0)
  1028			muse_remove_mtd_async(mc);
  1029		else
  1030			fuse_conn_put(mc->fc);
  1031		mutex_unlock(&mc->ref_mutex);
  1032	
  1033		return fuse_dev_release(inode, file);
  1034	}
  1035	
> 1036	static struct file_operations muse_ctrl_fops;
  1037	
  1038	static struct miscdevice muse_ctrl_dev = {
  1039		.minor = MISC_DYNAMIC_MINOR,
  1040		.name  = "muse",
  1041		.fops = &muse_ctrl_fops,
  1042	};
  1043	
  1044	static int __init muse_init(void)
  1045	{
  1046		/*
  1047		 * Inherit from fuse_dev_operations and override open() plus release().
  1048		 */
> 1049		muse_ctrl_fops = fuse_dev_operations;
> 1050		muse_ctrl_fops.owner = THIS_MODULE;
  1051		muse_ctrl_fops.open = muse_ctrl_open;
> 1052		muse_ctrl_fops.release = muse_ctrl_release;
  1053		/* Like CUSE, MUSE is not prepared for FUSE_DEV_IOC_CLONE */
  1054		muse_ctrl_fops.unlocked_ioctl = NULL;
  1055	
  1056		return misc_register(&muse_ctrl_dev);
  1057	}
  1058	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-29  1:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29  1:40 [rw-misc:muse-wip 8/9] drivers/mtd/muse.c:892:16: error: implicit declaration of function 'task_tgid_vnr' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.