public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Hannes Reinecke <hare@suse.de>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [hare-scsi-devel:ns-migration 17/18] drivers/nvme/host/core.c:4179:25: error: no member named 'lock' in 'struct nvme_ns_head'
Date: Thu, 3 Apr 2025 12:27:45 +0800	[thread overview]
Message-ID: <202504031248.OIkAofGD-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git ns-migration
head:   1cd2ac8db713fdf42bc7bb10329d795f7aee4f1f
commit: c99bbaa789ad558a900b867b376d68801acbbf9a [17/18] nvme: namespace migration
config: i386-buildonly-randconfig-003-20250403 (https://download.01.org/0day-ci/archive/20250403/202504031248.OIkAofGD-lkp@intel.com/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250403/202504031248.OIkAofGD-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/202504031248.OIkAofGD-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/nvme/host/core.c:3727:30: error: incompatible pointer types passing 'struct nvme_subsystem *' to parameter of type 'struct nvme_ctrl *' [-Werror,-Wincompatible-pointer-types]
    3727 |         ret = nvme_mpath_alloc_disk(subsys, head);
         |                                     ^~~~~~
   drivers/nvme/host/nvme.h:1008:59: note: passing argument to parameter 'ctrl' here
    1008 | static inline int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl,
         |                                                           ^
>> drivers/nvme/host/core.c:4179:25: error: no member named 'lock' in 'struct nvme_ns_head'
    4179 |                 mutex_lock(&ns->head->lock);
         |                             ~~~~~~~~  ^
   drivers/nvme/host/core.c:4182:28: error: no member named 'lock' in 'struct nvme_ns_head'
    4182 |                         mutex_unlock(&ns->head->lock);
         |                                       ~~~~~~~~  ^
   drivers/nvme/host/core.c:4193:27: error: no member named 'lock' in 'struct nvme_ns_head'
    4193 |                 mutex_unlock(&ns->head->lock);
         |                               ~~~~~~~~  ^
   drivers/nvme/host/core.c:4449:30: error: no member named 'ana_work' in 'struct nvme_ctrl'; did you mean 'ka_work'?
    4449 |                 queue_work(nvme_wq, &ctrl->ana_work);
         |                                            ^~~~~~~~
         |                                            ka_work
   drivers/nvme/host/nvme.h:356:22: note: 'ka_work' declared here
     356 |         struct delayed_work ka_work;
         |                             ^
   5 errors generated.


vim +4179 drivers/nvme/host/core.c

  4124	
  4125	static void nvme_validate_ns(struct nvme_ns *ns, struct nvme_ns_info *info)
  4126	{
  4127		int ret = NVME_SC_INVALID_NS | NVME_STATUS_DNR;
  4128		struct nvme_ctrl *ctrl = ns->ctrl;
  4129		struct nvme_subsystem *subsys, *old_subsys = NULL;
  4130		struct nvme_ns_head *head;
  4131	
  4132		if (!nvme_ns_ids_equal(&ns->head->ids, &info->ids)) {
  4133			dev_err(ns->ctrl->device,
  4134				"identifiers changed for nsid %d\n", ns->head->ns_id);
  4135			goto out;
  4136		}
  4137	
  4138		if (uuid_is_null(&info->ids.migration_uuid)) {
  4139			/*
  4140			 * Migration UUID not present:
  4141			 * use the controller subsystem
  4142			 */
  4143			subsys = ctrl->subsys;
  4144			kref_get(&subsys->ref);
  4145		} else if (uuid_is_null(&ns->head->ids.migration_uuid)) {
  4146			/*
  4147			 * Migration UUID present, but not set for ns_head:
  4148			 * create migration subsystem
  4149			 */
  4150			subsys = nvme_migration_subsys(info);
  4151			if (!subsys) {
  4152				dev_err(ctrl->device,
  4153					"nsid %u: failed to allocate migration subsys\n",
  4154					ns->head->ns_id);
  4155				goto out;
  4156			}
  4157		} else {
  4158			/*
  4159			 * Migration UUID present, and set for ns_head:
  4160			 * use ns_head subsystem
  4161			 */
  4162			subsys = ns->head->subsys;
  4163			kref_get(&subsys->ref);
  4164		}
  4165	
  4166		mutex_lock(&subsys->lock);
  4167		head = nvme_find_ns_head(subsys, ns->head->ns_id);
  4168		if (head) {
  4169			nvme_put_ns_head(head);
  4170			if (head != ns->head) {
  4171				dev_err(ctrl->device,
  4172					"nsid %u already present in subsys %s\n",
  4173					ns->head->ns_id, subsys->subnqn);
  4174				mutex_unlock(&subsys->lock);
  4175				nvme_put_subsystem(subsys);
  4176				goto out;
  4177			}
  4178		} else {
> 4179			mutex_lock(&ns->head->lock);
  4180			old_subsys = ns->head->subsys;
  4181			if (nvme_mpath_move_head(ns->head, subsys) < 0) {
  4182				mutex_unlock(&ns->head->lock);
  4183				mutex_unlock(&subsys->lock);
  4184				nvme_put_subsystem(subsys);
  4185				dev_err(ctrl->device,
  4186					"failed to move nsid %u to subsystem\n",
  4187					ns->head->ns_id);
  4188				old_subsys = NULL;
  4189				goto out;
  4190			}
  4191			kref_get(&subsys->ref);
  4192			ns->head->ids = info->ids;
  4193			mutex_unlock(&ns->head->lock);
  4194			mutex_unlock(&subsys->lock);
  4195		}
  4196		mutex_unlock(&subsys->lock);
  4197		nvme_put_subsystem(subsys);
  4198		if (old_subsys)
  4199			nvme_put_subsystem(old_subsys);
  4200	
  4201		ret = nvme_update_ns_info(ns, info);
  4202	out:
  4203		/*
  4204		 * Only remove the namespace if we got a fatal error back from the
  4205		 * device, otherwise ignore the error and just move on.
  4206		 *
  4207		 * TODO: we should probably schedule a delayed retry here.
  4208		 */
  4209		if (ret > 0 && (ret & NVME_STATUS_DNR))
  4210			nvme_ns_remove(ns);
  4211	}
  4212	

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

                 reply	other threads:[~2025-04-03  4:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202504031248.OIkAofGD-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=hare@suse.de \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox