Commit 9d0ad045 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'ceph-for-6.13-rc1' of https://github.com/ceph/ceph-client

Pull ceph updates from Ilya Dryomov:
 "A fix for the mount "device" string parser from Patrick and two cred
  reference counting fixups from Max, marked for stable.

  Also included a number of cleanups and a tweak to MAINTAINERS to avoid
  unnecessarily CCing netdev list"

* tag 'ceph-for-6.13-rc1' of https://github.com/ceph/ceph-client:
  ceph: fix cred leak in ceph_mds_check_access()
  ceph: pass cred pointer to ceph_mds_auth_match()
  ceph: improve caps debugging output
  ceph: correct ceph_mds_cap_peer field name
  ceph: correct ceph_mds_cap_item field name
  ceph: miscellaneous spelling fixes
  ceph: Use strscpy() instead of strcpy() in __get_snap_name()
  ceph: Use str_true_false() helper in status_show()
  ceph: requalify some char pointers as const
  ceph: extract entity name from device id
  MAINTAINERS: exclude net/ceph from networking
  ceph: Remove fs/ceph deadcode
  libceph: Remove unused ceph_crypto_key_encode
  libceph: Remove unused ceph_osdc_watch_check
  libceph: Remove unused pagevec functions
  libceph: Remove unused ceph_pagelist functions
parents baf67f6a c5cf4203
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -16353,6 +16353,7 @@ X: include/net/wext.h
X:	net/9p/
X:	net/bluetooth/
X:	net/can/
X:	net/ceph/
X:	net/mac80211/
X:	net/rfkill/
X:	net/wireless/
+1 −1
Original line number Diff line number Diff line
@@ -2195,7 +2195,7 @@ int ceph_pool_perm_check(struct inode *inode, int need)
	if (ci->i_vino.snap != CEPH_NOSNAP) {
		/*
		 * Pool permission check needs to write to the first object.
		 * But for snapshot, head of the first object may have alread
		 * But for snapshot, head of the first object may have already
		 * been deleted. Skip check to avoid creating orphan object.
		 */
		return 0;
+24 −39
Original line number Diff line number Diff line
@@ -978,20 +978,6 @@ int __ceph_caps_revoking_other(struct ceph_inode_info *ci,
	return 0;
}

int ceph_caps_revoking(struct ceph_inode_info *ci, int mask)
{
	struct inode *inode = &ci->netfs.inode;
	struct ceph_client *cl = ceph_inode_to_client(inode);
	int ret;

	spin_lock(&ci->i_ceph_lock);
	ret = __ceph_caps_revoking_other(ci, NULL, mask);
	spin_unlock(&ci->i_ceph_lock);
	doutc(cl, "%p %llx.%llx %s = %d\n", inode, ceph_vinop(inode),
	      ceph_cap_string(mask), ret);
	return ret;
}

int __ceph_caps_used(struct ceph_inode_info *ci)
{
	int used = 0;
@@ -2813,7 +2799,7 @@ void ceph_take_cap_refs(struct ceph_inode_info *ci, int got,
 * requested from the MDS.
 *
 * Returns 0 if caps were not able to be acquired (yet), 1 if succeed,
 * or a negative error code. There are 3 speical error codes:
 * or a negative error code. There are 3 special error codes:
 *  -EAGAIN:  need to sleep but non-blocking is specified
 *  -EFBIG:   ask caller to call check_max_size() and try again.
 *  -EUCLEAN: ask caller to call ceph_renew_caps() and try again.
@@ -4085,23 +4071,22 @@ static void handle_cap_export(struct inode *inode, struct ceph_mds_caps *ex,
	struct ceph_cap *cap, *tcap, *new_cap = NULL;
	struct ceph_inode_info *ci = ceph_inode(inode);
	u64 t_cap_id;
	unsigned mseq = le32_to_cpu(ex->migrate_seq);
	unsigned t_seq, t_mseq;
	u32 t_issue_seq, t_mseq;
	int target, issued;
	int mds = session->s_mds;

	if (ph) {
		t_cap_id = le64_to_cpu(ph->cap_id);
		t_seq = le32_to_cpu(ph->seq);
		t_issue_seq = le32_to_cpu(ph->issue_seq);
		t_mseq = le32_to_cpu(ph->mseq);
		target = le32_to_cpu(ph->mds);
	} else {
		t_cap_id = t_seq = t_mseq = 0;
		t_cap_id = t_issue_seq = t_mseq = 0;
		target = -1;
	}

	doutc(cl, "%p %llx.%llx ci %p mds%d mseq %d target %d\n",
	      inode, ceph_vinop(inode), ci, mds, mseq, target);
	doutc(cl, " cap %llx.%llx export to peer %d piseq %u pmseq %u\n",
	      ceph_vinop(inode), target, t_issue_seq, t_mseq);
retry:
	down_read(&mdsc->snap_rwsem);
	spin_lock(&ci->i_ceph_lock);
@@ -4134,12 +4119,12 @@ static void handle_cap_export(struct inode *inode, struct ceph_mds_caps *ex,
	if (tcap) {
		/* already have caps from the target */
		if (tcap->cap_id == t_cap_id &&
		    ceph_seq_cmp(tcap->seq, t_seq) < 0) {
		    ceph_seq_cmp(tcap->seq, t_issue_seq) < 0) {
			doutc(cl, " updating import cap %p mds%d\n", tcap,
			      target);
			tcap->cap_id = t_cap_id;
			tcap->seq = t_seq - 1;
			tcap->issue_seq = t_seq - 1;
			tcap->seq = t_issue_seq - 1;
			tcap->issue_seq = t_issue_seq - 1;
			tcap->issued |= issued;
			tcap->implemented |= issued;
			if (cap == ci->i_auth_cap) {
@@ -4154,7 +4139,7 @@ static void handle_cap_export(struct inode *inode, struct ceph_mds_caps *ex,
		int flag = (cap == ci->i_auth_cap) ? CEPH_CAP_FLAG_AUTH : 0;
		tcap = new_cap;
		ceph_add_cap(inode, tsession, t_cap_id, issued, 0,
			     t_seq - 1, t_mseq, (u64)-1, flag, &new_cap);
			     t_issue_seq - 1, t_mseq, (u64)-1, flag, &new_cap);

		if (!list_empty(&ci->i_cap_flush_list) &&
		    ci->i_auth_cap == tcap) {
@@ -4228,18 +4213,22 @@ static void handle_cap_import(struct ceph_mds_client *mdsc,
	u64 realmino = le64_to_cpu(im->realm);
	u64 cap_id = le64_to_cpu(im->cap_id);
	u64 p_cap_id;
	u32 piseq = 0;
	u32 pmseq = 0;
	int peer;

	if (ph) {
		p_cap_id = le64_to_cpu(ph->cap_id);
		peer = le32_to_cpu(ph->mds);
		piseq = le32_to_cpu(ph->issue_seq);
		pmseq = le32_to_cpu(ph->mseq);
	} else {
		p_cap_id = 0;
		peer = -1;
	}

	doutc(cl, "%p %llx.%llx ci %p mds%d mseq %d peer %d\n",
	      inode, ceph_vinop(inode), ci, mds, mseq, peer);
	doutc(cl, " cap %llx.%llx import from peer %d piseq %u pmseq %u\n",
	      ceph_vinop(inode), peer, piseq, pmseq);
retry:
	cap = __get_cap_for_mds(ci, mds);
	if (!cap) {
@@ -4268,15 +4257,13 @@ static void handle_cap_import(struct ceph_mds_client *mdsc,
		doutc(cl, " remove export cap %p mds%d flags %d\n",
		      ocap, peer, ph->flags);
		if ((ph->flags & CEPH_CAP_FLAG_AUTH) &&
		    (ocap->seq != le32_to_cpu(ph->seq) ||
		     ocap->mseq != le32_to_cpu(ph->mseq))) {
		    (ocap->seq != piseq ||
		     ocap->mseq != pmseq)) {
			pr_err_ratelimited_client(cl, "mismatched seq/mseq: "
					"%p %llx.%llx mds%d seq %d mseq %d"
					" importer mds%d has peer seq %d mseq %d\n",
					inode, ceph_vinop(inode), peer,
					ocap->seq, ocap->mseq, mds,
					le32_to_cpu(ph->seq),
					le32_to_cpu(ph->mseq));
					ocap->seq, ocap->mseq, mds, piseq, pmseq);
		}
		ceph_remove_cap(mdsc, ocap, (ph->flags & CEPH_CAP_FLAG_RELEASE));
	}
@@ -4350,7 +4337,7 @@ void ceph_handle_caps(struct ceph_mds_session *session,
	struct ceph_snap_realm *realm = NULL;
	int op;
	int msg_version = le16_to_cpu(msg->hdr.version);
	u32 seq, mseq;
	u32 seq, mseq, issue_seq;
	struct ceph_vino vino;
	void *snaptrace;
	size_t snaptrace_len;
@@ -4360,8 +4347,6 @@ void ceph_handle_caps(struct ceph_mds_session *session,
	bool close_sessions = false;
	bool do_cap_release = false;

	doutc(cl, "from mds%d\n", session->s_mds);

	if (!ceph_inc_mds_stopping_blocker(mdsc, session))
		return;

@@ -4375,6 +4360,7 @@ void ceph_handle_caps(struct ceph_mds_session *session,
	vino.snap = CEPH_NOSNAP;
	seq = le32_to_cpu(h->seq);
	mseq = le32_to_cpu(h->migrate_seq);
	issue_seq = le32_to_cpu(h->issue_seq);

	snaptrace = h + 1;
	snaptrace_len = le32_to_cpu(h->snap_trace_len);
@@ -4462,12 +4448,11 @@ void ceph_handle_caps(struct ceph_mds_session *session,

	/* lookup ino */
	inode = ceph_find_inode(mdsc->fsc->sb, vino);
	doutc(cl, " op %s ino %llx.%llx inode %p\n", ceph_cap_op_name(op),
	      vino.ino, vino.snap, inode);
	doutc(cl, " caps mds%d op %s ino %llx.%llx inode %p seq %u iseq %u mseq %u\n",
	      session->s_mds, ceph_cap_op_name(op), vino.ino, vino.snap, inode,
	      seq, issue_seq, mseq);

	mutex_lock(&session->s_mutex);
	doutc(cl, " mds%d seq %lld cap seq %u\n", session->s_mds,
	      session->s_seq, (unsigned)seq);

	if (!inode) {
		doutc(cl, " i don't have ino %llx\n", vino.ino);
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ struct ceph_fname {
};

/*
 * Header for the crypted file when truncating the size, this
 * Header for the encrypted file when truncating the size, this
 * will be sent to MDS, and the MDS will update the encrypted
 * last block and then truncate the size.
 */
+1 −1
Original line number Diff line number Diff line
@@ -357,7 +357,7 @@ static int status_show(struct seq_file *s, void *p)

	seq_printf(s, "instance: %s.%lld %s/%u\n", ENTITY_NAME(inst->name),
		   ceph_pr_addr(client_addr), le32_to_cpu(client_addr->nonce));
	seq_printf(s, "blocklisted: %s\n", fsc->blocklisted ? "true" : "false");
	seq_printf(s, "blocklisted: %s\n", str_true_false(fsc->blocklisted));

	return 0;
}
Loading