Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Kaho Jiang <kj2864@nyu.edu>, Ilya Dryomov <idryomov@gmail.com>,
	Alex Markuze <amarkuze@redhat.com>, Xiubo Li <xiubo.li@clyso.com>,
	Viacheslav Dubeyko <slava@dubeyko.com>
Cc: oe-kbuild-all@lists.linux.dev, ceph-devel@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	co+408fcc361565713f@bugs.sh, Kaho Jiang <kj2864@nyu.edu>
Subject: Re: [PATCH v5 2/2] ceph: defer the blocklist and fence off the MDS worker
Date: Wed, 2 Dec 2026 23:30:31 +0800	[thread overview]
Message-ID: <20261202232609.3qv8TXnG-lkp@intel.com> (raw)
In-Reply-To: <20261202045041.130195-2-kj2864@nyu.edu>

Hi Kaho,

kernel test robot noticed the following build errors:

[auto build test ERROR on ceph-client/testing]
[cannot apply to ceph-client/for-linus linus/master v7.4-rc5 next-20261130]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Kaho-Jiang/ceph-defer-the-blocklist-and-fence-off-the-MDS-worker/20261201-235041
base:   https://github.com/ceph/ceph-client.git testing
patch link:    https://lore.kernel.org/r/20261202045041.130195-2-kj2864%40nyu.edu
patch subject: [PATCH v5 2/2] ceph: defer the blocklist and fence off the MDS worker
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20261202/20261202232609.3qv8TXnG-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261202/20261202232609.3qv8TXnG-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/20261202232609.3qv8TXnG-lkp@intel.com/

All errors (new ones prefixed by >>):

   fs/ceph/mds_client.c: In function 'handle_reply':
>> fs/ceph/mds_client.c:4377:66: error: invalid operands to binary & (have 'struct inode_state_flags' and 'int')
    4377 |         if (req->r_target_inode && (req->r_target_inode->i_state & I_NEW))
         |                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
         |                                                        |
         |                                                        struct inode_state_flags


vim +4377 fs/ceph/mds_client.c

  4158	
  4159	/*
  4160	 * Handle mds reply.
  4161	 *
  4162	 * We take the session mutex and parse and process the reply immediately.
  4163	 * This preserves the logical ordering of replies, capabilities, etc., sent
  4164	 * by the MDS as they are applied to our local cache.
  4165	 */
  4166	static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)
  4167	{
  4168		struct ceph_mds_client *mdsc = session->s_mdsc;
  4169		struct ceph_client *cl = mdsc->fsc->client;
  4170		struct ceph_mds_request *req;
  4171		struct ceph_mds_reply_head *head = msg->front.iov_base;
  4172		struct ceph_mds_reply_info_parsed *rinfo;  /* parsed reply info */
  4173		struct ceph_snap_realm *realm;
  4174		unsigned int nofs_flags;
  4175		struct dentry *lookup_dn;
  4176		u64 tid;
  4177		int err, result;
  4178		int mds = session->s_mds;
  4179		bool close_sessions = false;
  4180	
  4181		if (msg->front.iov_len < sizeof(*head)) {
  4182			pr_err_client(cl, "got corrupt (short) reply\n");
  4183			ceph_msg_dump(msg);
  4184			return;
  4185		}
  4186	
  4187		/* get request, session */
  4188		tid = le64_to_cpu(msg->hdr.tid);
  4189		mutex_lock(&mdsc->mutex);
  4190		req = lookup_get_request(mdsc, tid);
  4191		if (!req) {
  4192			doutc(cl, "on unknown tid %llu\n", tid);
  4193			mutex_unlock(&mdsc->mutex);
  4194			return;
  4195		}
  4196		doutc(cl, "handle_reply %p\n", req);
  4197	
  4198		/* correct session? */
  4199		if (req->r_session != session) {
  4200			pr_err_client(cl, "got %llu on session mds%d not mds%d\n",
  4201				      tid, session->s_mds,
  4202				      req->r_session ? req->r_session->s_mds : -1);
  4203			mutex_unlock(&mdsc->mutex);
  4204			goto out;
  4205		}
  4206	
  4207		/* dup? */
  4208		if ((test_bit(CEPH_MDS_R_GOT_UNSAFE, &req->r_req_flags) && !head->safe) ||
  4209		    (test_bit(CEPH_MDS_R_GOT_SAFE, &req->r_req_flags) && head->safe)) {
  4210			pr_warn_client(cl, "got a dup %s reply on %llu from mds%d\n",
  4211				       head->safe ? "safe" : "unsafe", tid, mds);
  4212			mutex_unlock(&mdsc->mutex);
  4213			goto out;
  4214		}
  4215		if (test_bit(CEPH_MDS_R_GOT_SAFE, &req->r_req_flags)) {
  4216			pr_warn_client(cl, "got unsafe after safe on %llu from mds%d\n",
  4217				       tid, mds);
  4218			mutex_unlock(&mdsc->mutex);
  4219			goto out;
  4220		}
  4221	
  4222		result = le32_to_cpu(head->result);
  4223	
  4224		if (head->safe) {
  4225			set_bit(CEPH_MDS_R_GOT_SAFE, &req->r_req_flags);
  4226			__unregister_request(mdsc, req);
  4227	
  4228			/* last request during umount? */
  4229			if (mdsc->stopping && !__get_oldest_req(mdsc))
  4230				complete_all(&mdsc->safe_umount_waiters);
  4231	
  4232			if (test_bit(CEPH_MDS_R_GOT_UNSAFE, &req->r_req_flags)) {
  4233				/*
  4234				 * We already handled the unsafe response, now do the
  4235				 * cleanup.  No need to examine the response; the MDS
  4236				 * doesn't include any result info in the safe
  4237				 * response.  And even if it did, there is nothing
  4238				 * useful we could do with a revised return value.
  4239				 */
  4240				doutc(cl, "got safe reply %llu, mds%d\n", tid, mds);
  4241	
  4242				mutex_unlock(&mdsc->mutex);
  4243				goto out;
  4244			}
  4245		} else {
  4246			set_bit(CEPH_MDS_R_GOT_UNSAFE, &req->r_req_flags);
  4247			list_add_tail(&req->r_unsafe_item, &req->r_session->s_unsafe);
  4248		}
  4249	
  4250		/*
  4251		 * Now that all mutex-protected state has been updated above
  4252		 * (the request has been unregistered or added to the
  4253		 * session's unsafe list), we can unlock it.
  4254		 */
  4255		mutex_unlock(&mdsc->mutex);
  4256	
  4257		doutc(cl, "tid %lld result %d\n", tid, result);
  4258		if (test_bit(CEPHFS_FEATURE_REPLY_ENCODING, &session->s_features))
  4259			err = parse_reply_info(session, msg, req, (u64)-1);
  4260		else
  4261			err = parse_reply_info(session, msg, req,
  4262					       session->s_con.peer_features);
  4263	
  4264		/* Must find target inode outside of mutexes to avoid deadlocks */
  4265		rinfo = &req->r_reply_info;
  4266		if ((err >= 0) && rinfo->head->is_target) {
  4267			struct inode *in = xchg(&req->r_new_inode, NULL);
  4268			struct ceph_vino tvino = {
  4269				.ino  = le64_to_cpu(rinfo->targeti.in->ino),
  4270				.snap = le64_to_cpu(rinfo->targeti.in->snapid)
  4271			};
  4272	
  4273			/*
  4274			 * If we ended up opening an existing inode, discard
  4275			 * r_new_inode
  4276			 */
  4277			if (req->r_op == CEPH_MDS_OP_CREATE &&
  4278			    !req->r_reply_info.has_create_ino) {
  4279				/* This should never happen on an async create */
  4280				WARN_ON_ONCE(req->r_deleg_ino);
  4281				iput(in);
  4282				in = NULL;
  4283			}
  4284	
  4285			in = ceph_get_inode(mdsc->fsc->sb, tvino, in);
  4286			if (IS_ERR(in)) {
  4287				err = PTR_ERR(in);
  4288				mutex_lock(&session->s_mutex);
  4289				goto out_err;
  4290			}
  4291			req->r_target_inode = in;
  4292			ceph_inode_set_subvolume(in, rinfo->targeti.subvolume_id);
  4293		}
  4294	
  4295		mutex_lock(&session->s_mutex);
  4296		if (err < 0) {
  4297			pr_err_client(cl, "got corrupt reply mds%d(tid:%lld)\n",
  4298				      mds, tid);
  4299			ceph_msg_dump(msg);
  4300			goto out_err;
  4301		}
  4302	
  4303		/* snap trace */
  4304		realm = NULL;
  4305		if (rinfo->snapblob_len) {
  4306			down_write(&mdsc->snap_rwsem);
  4307			err = ceph_update_snap_trace(mdsc, rinfo->snapblob,
  4308					rinfo->snapblob + rinfo->snapblob_len,
  4309					le32_to_cpu(head->op) == CEPH_MDS_OP_RMSNAP,
  4310					&realm);
  4311			if (err) {
  4312				up_write(&mdsc->snap_rwsem);
  4313				close_sessions = true;
  4314				if (err == -EIO)
  4315					ceph_msg_dump(msg);
  4316				goto out_err;
  4317			}
  4318			downgrade_write(&mdsc->snap_rwsem);
  4319		} else {
  4320			down_read(&mdsc->snap_rwsem);
  4321		}
  4322	
  4323		/* insert trace into our cache */
  4324		mutex_lock(&req->r_fill_mutex);
  4325	
  4326		/*
  4327		 * ceph_fill_trace() may end the lookup of an in-lookup r_dentry
  4328		 * (d_splice_alias()), which lockdep sees as releasing its
  4329		 * DCACHE_PAR_LOOKUP lock: own it here meanwhile, see
  4330		 * ceph_mdsc_do_request().  splice_dentry() may replace r_dentry.
  4331		 */
  4332		lookup_dn = NULL;
  4333		if (test_bit(CEPH_MDS_R_LOOKUP_HANDOFF, &req->r_req_flags)) {
  4334			lookup_dn = req->r_dentry;
  4335			d_lookup_acquire(lookup_dn);
  4336		}
  4337	
  4338		/* disable fs reclaim while we are using current->journal_info
  4339		 * for our own purposes, or else shrinkers of other
  4340		 * filesystems might dereference this pointer as a different
  4341		 * type
  4342		 */
  4343		nofs_flags = memalloc_nofs_save();
  4344	
  4345		current->journal_info = req;
  4346		err = ceph_fill_trace(mdsc->fsc->sb, req);
  4347		if (err == 0) {
  4348			if (result == 0 && (req->r_op == CEPH_MDS_OP_READDIR ||
  4349					    req->r_op == CEPH_MDS_OP_LSSNAP))
  4350				err = ceph_readdir_prepopulate(req, req->r_session);
  4351		}
  4352		current->journal_info = NULL;
  4353		memalloc_nofs_restore(nofs_flags);
  4354	
  4355		if (lookup_dn)
  4356			d_lookup_release(lookup_dn);
  4357		mutex_unlock(&req->r_fill_mutex);
  4358	
  4359		up_read(&mdsc->snap_rwsem);
  4360		if (realm)
  4361			ceph_put_snap_realm(mdsc, realm);
  4362	
  4363		if (err == 0) {
  4364			if (req->r_target_inode &&
  4365			    test_bit(CEPH_MDS_R_GOT_UNSAFE, &req->r_req_flags)) {
  4366				struct ceph_inode_info *ci =
  4367					ceph_inode(req->r_target_inode);
  4368				spin_lock(&ci->i_unsafe_lock);
  4369				list_add_tail(&req->r_unsafe_target_item,
  4370					      &ci->i_unsafe_iops);
  4371				spin_unlock(&ci->i_unsafe_lock);
  4372			}
  4373	
  4374			ceph_unreserve_caps(mdsc, &req->r_caps_reservation);
  4375		}
  4376	out_err:
> 4377		if (req->r_target_inode && (req->r_target_inode->i_state & I_NEW))
  4378			discard_new_inode(req->r_target_inode);
  4379	
  4380		mutex_lock(&mdsc->mutex);
  4381		if (!test_bit(CEPH_MDS_R_ABORTED, &req->r_req_flags)) {
  4382			if (err) {
  4383				req->r_err = err;
  4384			} else {
  4385				req->r_reply =  ceph_msg_get(msg);
  4386				set_bit(CEPH_MDS_R_GOT_RESULT, &req->r_req_flags);
  4387			}
  4388		} else {
  4389			doutc(cl, "reply arrived after request %lld was aborted\n", tid);
  4390		}
  4391		mutex_unlock(&mdsc->mutex);
  4392	
  4393		mutex_unlock(&session->s_mutex);
  4394	
  4395		/* kick calling process */
  4396		complete_request(mdsc, req);
  4397	
  4398		ceph_update_metadata_metrics(&mdsc->metric, req->r_start_latency,
  4399					     req->r_end_latency, err);
  4400	out:
  4401		ceph_mdsc_put_request(req);
  4402	
  4403		/* Defer closing the sessions after s_mutex lock being released */
  4404		if (close_sessions)
  4405			ceph_mdsc_schedule_snap_fence(mdsc);
  4406		return;
  4407	}
  4408	

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

      parent reply	other threads:[~2026-12-02 15:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  4:50 [PATCH v5 1/2] ceph: Use unsigned types for snapshot split counts Kaho Jiang
2026-12-02  4:50 ` [PATCH v5 2/2] ceph: defer the blocklist and fence off the MDS worker Kaho Jiang
2026-12-02 15:13   ` Alex Markuze
2026-12-02 15:30   ` kernel test robot [this message]

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=20261202232609.3qv8TXnG-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=amarkuze@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=co+408fcc361565713f@bugs.sh \
    --cc=idryomov@gmail.com \
    --cc=kj2864@nyu.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=slava@dubeyko.com \
    --cc=stable@vger.kernel.org \
    --cc=xiubo.li@clyso.com \
    /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