Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f753c4ec authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull ceph fixes from Sage Weil:
 "Jim's fix closes a narrow race introduced with the msgr changes.  One
  fix resolves problems with debugfs initialization that Yan found when
  multiple client instances are created (e.g., two clusters mounted, or
  rbd + cephfs), another one fixes problems with mounting a nonexistent
  server subdirectory, and the last one fixes a divide by zero error
  from unsanitized ioctl input that Dan Carpenter found."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
  ceph: avoid divide by zero in __validate_layout()
  libceph: avoid truncation due to racing banners
  ceph: tolerate (and warn on) extraneous dentry from mds
  libceph: delay debugfs initialization until we learn global_id
parents ad746be9 45f2e081
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -201,6 +201,7 @@ int ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
	int err = -ENOMEM;
	int err = -ENOMEM;


	dout("ceph_fs_debugfs_init\n");
	dout("ceph_fs_debugfs_init\n");
	BUG_ON(!fsc->client->debugfs_dir);
	fsc->debugfs_congestion_kb =
	fsc->debugfs_congestion_kb =
		debugfs_create_file("writeback_congestion_kb",
		debugfs_create_file("writeback_congestion_kb",
				    0600,
				    0600,
+10 −5
Original line number Original line Diff line number Diff line
@@ -992,11 +992,15 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
	if (rinfo->head->is_dentry) {
	if (rinfo->head->is_dentry) {
		struct inode *dir = req->r_locked_dir;
		struct inode *dir = req->r_locked_dir;


		if (dir) {
			err = fill_inode(dir, &rinfo->diri, rinfo->dirfrag,
			err = fill_inode(dir, &rinfo->diri, rinfo->dirfrag,
					 session, req->r_request_started, -1,
					 session, req->r_request_started, -1,
					 &req->r_caps_reservation);
					 &req->r_caps_reservation);
			if (err < 0)
			if (err < 0)
				return err;
				return err;
		} else {
			WARN_ON_ONCE(1);
		}
	}
	}


	/*
	/*
@@ -1004,6 +1008,7 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
	 * will have trouble splicing in the virtual snapdir later
	 * will have trouble splicing in the virtual snapdir later
	 */
	 */
	if (rinfo->head->is_dentry && !req->r_aborted &&
	if (rinfo->head->is_dentry && !req->r_aborted &&
	    req->r_locked_dir &&
	    (rinfo->head->is_target || strncmp(req->r_dentry->d_name.name,
	    (rinfo->head->is_target || strncmp(req->r_dentry->d_name.name,
					       fsc->mount_options->snapdir_name,
					       fsc->mount_options->snapdir_name,
					       req->r_dentry->d_name.len))) {
					       req->r_dentry->d_name.len))) {
+2 −1
Original line number Original line Diff line number Diff line
@@ -42,7 +42,8 @@ static long __validate_layout(struct ceph_mds_client *mdsc,
	/* validate striping parameters */
	/* validate striping parameters */
	if ((l->object_size & ~PAGE_MASK) ||
	if ((l->object_size & ~PAGE_MASK) ||
	    (l->stripe_unit & ~PAGE_MASK) ||
	    (l->stripe_unit & ~PAGE_MASK) ||
	    ((unsigned)l->object_size % (unsigned)l->stripe_unit))
	    (l->stripe_unit != 0 &&
	     ((unsigned)l->object_size % (unsigned)l->stripe_unit)))
		return -EINVAL;
		return -EINVAL;


	/* make sure it's a valid data pool */
	/* make sure it's a valid data pool */
+0 −1
Original line number Original line Diff line number Diff line
@@ -84,7 +84,6 @@ int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid)
			return -1;
			return -1;
		}
		}
	} else {
	} else {
		pr_info("client%lld fsid %pU\n", ceph_client_id(client), fsid);
		memcpy(&client->fsid, fsid, sizeof(*fsid));
		memcpy(&client->fsid, fsid, sizeof(*fsid));
	}
	}
	return 0;
	return 0;
+4 −0
Original line number Original line Diff line number Diff line
@@ -189,6 +189,9 @@ int ceph_debugfs_client_init(struct ceph_client *client)
	snprintf(name, sizeof(name), "%pU.client%lld", &client->fsid,
	snprintf(name, sizeof(name), "%pU.client%lld", &client->fsid,
		 client->monc.auth->global_id);
		 client->monc.auth->global_id);


	dout("ceph_debugfs_client_init %p %s\n", client, name);

	BUG_ON(client->debugfs_dir);
	client->debugfs_dir = debugfs_create_dir(name, ceph_debugfs_dir);
	client->debugfs_dir = debugfs_create_dir(name, ceph_debugfs_dir);
	if (!client->debugfs_dir)
	if (!client->debugfs_dir)
		goto out;
		goto out;
@@ -234,6 +237,7 @@ int ceph_debugfs_client_init(struct ceph_client *client)


void ceph_debugfs_client_cleanup(struct ceph_client *client)
void ceph_debugfs_client_cleanup(struct ceph_client *client)
{
{
	dout("ceph_debugfs_client_cleanup %p\n", client);
	debugfs_remove(client->debugfs_osdmap);
	debugfs_remove(client->debugfs_osdmap);
	debugfs_remove(client->debugfs_monmap);
	debugfs_remove(client->debugfs_monmap);
	debugfs_remove(client->osdc.debugfs_file);
	debugfs_remove(client->osdc.debugfs_file);
Loading