Commit be695ee2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'ceph-for-5.11-rc1' of git://github.com/ceph/ceph-client

Pull ceph updates from Ilya Dryomov:
 "The big ticket item here is support for msgr2 on-wire protocol, which
  adds the option of full in-transit encryption using AES-GCM algorithm
  (myself).

  On top of that we have a series to avoid intermittent errors during
  recovery with recover_session=clean and some MDS request encoding work
  from Jeff, a cap handling fix and assorted observability improvements
  from Luis and Xiubo and a good number of cleanups.

  Luis also ran into a corner case with quotas which sadly means that we
  are back to denying cross-quota-realm renames"

* tag 'ceph-for-5.11-rc1' of git://github.com/ceph/ceph-client: (59 commits)
  libceph: drop ceph_auth_{create,update}_authorizer()
  libceph, ceph: make use of __ceph_auth_get_authorizer() in msgr1
  libceph, ceph: implement msgr2.1 protocol (crc and secure modes)
  libceph: introduce connection modes and ms_mode option
  libceph, rbd: ignore addr->type while comparing in some cases
  libceph, ceph: get and handle cluster maps with addrvecs
  libceph: factor out finish_auth()
  libceph: drop ac->ops->name field
  libceph: amend cephx init_protocol() and build_request()
  libceph, ceph: incorporate nautilus cephx changes
  libceph: safer en/decoding of cephx requests and replies
  libceph: more insight into ticket expiry and invalidation
  libceph: move msgr1 protocol specific fields to its own struct
  libceph: move msgr1 protocol implementation to its own file
  libceph: separate msgr1 protocol implementation
  libceph: export remaining protocol independent infrastructure
  libceph: export zero_page
  libceph: rename and export con->flags bits
  libceph: rename and export con->state states
  libceph: make con->state an int
  ...
parents 92dbc9de 2f0df6cf
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -3925,8 +3925,12 @@ static int find_watcher(struct rbd_device *rbd_dev,

	sscanf(locker->id.cookie, RBD_LOCK_COOKIE_PREFIX " %llu", &cookie);
	for (i = 0; i < num_watchers; i++) {
		if (!memcmp(&watchers[i].addr, &locker->info.addr,
			    sizeof(locker->info.addr)) &&
		/*
		 * Ignore addr->type while comparing.  This mimics
		 * entity_addr_t::get_legacy_str() + strcmp().
		 */
		if (ceph_addr_equal_no_type(&watchers[i].addr,
					    &locker->info.addr) &&
		    watchers[i].cookie == cookie) {
			struct rbd_client_id cid = {
				.gid = le64_to_cpu(watchers[i].name.num),
+3 −3
Original line number Diff line number Diff line
@@ -840,7 +840,7 @@ static int ceph_writepages_start(struct address_space *mapping,
	     wbc->sync_mode == WB_SYNC_NONE ? "NONE" :
	     (wbc->sync_mode == WB_SYNC_ALL ? "ALL" : "HOLD"));

	if (READ_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) {
	if (READ_ONCE(fsc->mount_state) >= CEPH_MOUNT_SHUTDOWN) {
		if (ci->i_wrbuffer_ref > 0) {
			pr_warn_ratelimited(
				"writepage_start %p %lld forced umount\n",
@@ -1264,7 +1264,7 @@ ceph_find_incompatible(struct page *page)
	struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
	struct ceph_inode_info *ci = ceph_inode(inode);

	if (READ_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) {
	if (READ_ONCE(fsc->mount_state) >= CEPH_MOUNT_SHUTDOWN) {
		dout(" page %p forced umount\n", page);
		return ERR_PTR(-EIO);
	}
@@ -1321,7 +1321,7 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping,
	dout("write_begin file %p inode %p page %p %d~%d\n", file, inode, page, (int)pos, (int)len);

	for (;;) {
		page = grab_cache_page_write_begin(mapping, index, 0);
		page = grab_cache_page_write_begin(mapping, index, flags);
		if (!page) {
			r = -ENOMEM;
			break;
+16 −11
Original line number Diff line number Diff line
@@ -1140,16 +1140,24 @@ void __ceph_remove_cap(struct ceph_cap *cap, bool queue_release)
{
	struct ceph_mds_session *session = cap->session;
	struct ceph_inode_info *ci = cap->ci;
	struct ceph_mds_client *mdsc =
		ceph_sb_to_client(ci->vfs_inode.i_sb)->mdsc;
	struct ceph_mds_client *mdsc;
	int removed = 0;

	/* 'ci' being NULL means the remove have already occurred */
	if (!ci) {
		dout("%s: cap inode is NULL\n", __func__);
		return;
	}

	dout("__ceph_remove_cap %p from %p\n", cap, &ci->vfs_inode);

	mdsc = ceph_inode_to_client(&ci->vfs_inode)->mdsc;

	/* remove from inode's cap rbtree, and clear auth cap */
	rb_erase(&cap->ci_node, &ci->i_caps);
	if (ci->i_auth_cap == cap) {
		WARN_ON_ONCE(!list_empty(&ci->i_dirty_item));
		WARN_ON_ONCE(!list_empty(&ci->i_dirty_item) &&
			     !mdsc->fsc->blocklisted);
		ci->i_auth_cap = NULL;
	}

@@ -2746,7 +2754,7 @@ again:
			goto out_unlock;
		}

		if (READ_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) {
		if (READ_ONCE(mdsc->fsc->mount_state) >= CEPH_MOUNT_SHUTDOWN) {
			dout("get_cap_refs %p forced umount\n", inode);
			ret = -EIO;
			goto out_unlock;
@@ -4027,15 +4035,13 @@ void ceph_handle_caps(struct ceph_mds_session *session,
	}

	if (msg_version >= 8) {
		u64 flush_tid;
		u32 caller_uid, caller_gid;
		u32 pool_ns_len;

		/* version >= 6 */
		ceph_decode_64_safe(&p, end, flush_tid, bad);
		ceph_decode_skip_64(&p, end, bad);	// flush_tid
		/* version >= 7 */
		ceph_decode_32_safe(&p, end, caller_uid, bad);
		ceph_decode_32_safe(&p, end, caller_gid, bad);
		ceph_decode_skip_32(&p, end, bad);	// caller_uid
		ceph_decode_skip_32(&p, end, bad);	// caller_gid
		/* version >= 8 */
		ceph_decode_32_safe(&p, end, pool_ns_len, bad);
		if (pool_ns_len > 0) {
@@ -4058,9 +4064,8 @@ void ceph_handle_caps(struct ceph_mds_session *session,
	}

	if (msg_version >= 11) {
		u32 flags;
		/* version >= 10 */
		ceph_decode_32_safe(&p, end, flags, bad);
		ceph_decode_skip_32(&p, end, bad); // flags
		/* version >= 11 */
		extra_info.dirstat_valid = true;
		ceph_decode_64_safe(&p, end, extra_info.nfiles, bad);
+20 −0
Original line number Diff line number Diff line
@@ -304,11 +304,25 @@ static int mds_sessions_show(struct seq_file *s, void *ptr)
	return 0;
}

static int status_show(struct seq_file *s, void *p)
{
	struct ceph_fs_client *fsc = s->private;
	struct ceph_entity_inst *inst = &fsc->client->msgr.inst;
	struct ceph_entity_addr *client_addr = ceph_client_addr(fsc->client);

	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");

	return 0;
}

DEFINE_SHOW_ATTRIBUTE(mdsmap);
DEFINE_SHOW_ATTRIBUTE(mdsc);
DEFINE_SHOW_ATTRIBUTE(caps);
DEFINE_SHOW_ATTRIBUTE(mds_sessions);
DEFINE_SHOW_ATTRIBUTE(metric);
DEFINE_SHOW_ATTRIBUTE(status);


/*
@@ -394,6 +408,12 @@ void ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
						fsc->client->debugfs_dir,
						fsc,
						&caps_fops);

	fsc->debugfs_status = debugfs_create_file("status",
						  0400,
						  fsc->client->debugfs_dir,
						  fsc,
						  &status_fops);
}


+4 −5
Original line number Diff line number Diff line
@@ -1202,12 +1202,11 @@ static int ceph_rename(struct inode *old_dir, struct dentry *old_dentry,
			op = CEPH_MDS_OP_RENAMESNAP;
		else
			return -EROFS;
	} else if (old_dir != new_dir) {
		err = ceph_quota_check_rename(mdsc, d_inode(old_dentry),
					      new_dir);
		if (err)
			return err;
	}
	/* don't allow cross-quota renames */
	if ((old_dir != new_dir) &&
	    (!ceph_quota_is_same_realm(old_dir, new_dir)))
		return -EXDEV;

	dout("rename dir %p dentry %p to dir %p dentry %p\n",
	     old_dir, old_dentry, new_dir, new_dentry);
Loading