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

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

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

Pull ceph updates from Ilya Dryomov:
 "The highlights include:

   - a large series of fixes and improvements to the snapshot-handling
     code (Zheng Yan)

   - individual read/write OSD requests passed down to libceph are now
     limited to 16M in size to avoid hitting OSD-side limits (Zheng Yan)

   - encode MStatfs v2 message to allow for more accurate space usage
     reporting (Douglas Fuller)

   - switch to the new writeback error tracking infrastructure (Jeff
     Layton)"

* tag 'ceph-for-4.14-rc1' of git://github.com/ceph/ceph-client: (35 commits)
  ceph: stop on-going cached readdir if mds revokes FILE_SHARED cap
  ceph: wait on writeback after writing snapshot data
  ceph: fix capsnap dirty pages accounting
  ceph: ignore wbc->range_{start,end} when write back snapshot data
  ceph: fix "range cyclic" mode writepages
  ceph: cleanup local variables in ceph_writepages_start()
  ceph: optimize pagevec iterating in ceph_writepages_start()
  ceph: make writepage_nounlock() invalidate page that beyonds EOF
  ceph: properly get capsnap's size in get_oldest_context()
  ceph: remove stale check in ceph_invalidatepage()
  ceph: queue cap snap only when snap realm's context changes
  ceph: handle race between vmtruncate and queuing cap snap
  ceph: fix message order check in handle_cap_export()
  ceph: fix NULL pointer dereference in ceph_flush_snaps()
  ceph: adjust 36 checks for NULL pointers
  ceph: delete an unnecessary return statement in update_dentry_lease()
  ceph: ENOMEM pr_err in __get_or_create_frag() is redundant
  ceph: check negative offsets in ceph_llseek()
  ceph: more accurate statfs
  ceph: properly set snap follows for cap reconnect
  ...
parents b31ff3cd 15b51bd6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3435,7 +3435,7 @@ static void rbd_acquire_lock(struct work_struct *work)
	struct rbd_device *rbd_dev = container_of(to_delayed_work(work),
					    struct rbd_device, lock_dwork);
	enum rbd_lock_state lock_state;
	int ret;
	int ret = 0;

	dout("%s rbd_dev %p\n", __func__, rbd_dev);
again:
+224 −179

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -209,7 +209,7 @@ void ceph_fscache_register_inode_cookie(struct inode *inode)
	struct ceph_fs_client *fsc = ceph_inode_to_client(inode);

	/* No caching for filesystem */
	if (fsc->fscache == NULL)
	if (!fsc->fscache)
		return;

	/* Only cache for regular files that are read only */
+23 −17
Original line number Diff line number Diff line
@@ -490,12 +490,13 @@ static void __check_cap_issue(struct ceph_inode_info *ci, struct ceph_cap *cap,
	}

	/*
	 * if we are newly issued FILE_SHARED, mark dir not complete; we
	 * don't know what happened to this directory while we didn't
	 * have the cap.
	 * If FILE_SHARED is newly issued, mark dir not complete. We don't
	 * know what happened to this directory while we didn't have the cap.
	 * If FILE_SHARED is being revoked, also mark dir not complete. It
	 * stops on-going cached readdir.
	 */
	if ((issued & CEPH_CAP_FILE_SHARED) &&
	    (had & CEPH_CAP_FILE_SHARED) == 0) {
	if ((issued & CEPH_CAP_FILE_SHARED) != (had & CEPH_CAP_FILE_SHARED)) {
		if (issued & CEPH_CAP_FILE_SHARED)
			ci->i_shared_gen++;
		if (S_ISDIR(ci->vfs_inode.i_mode)) {
			dout(" marking %p NOT complete\n", &ci->vfs_inode);
@@ -611,7 +612,7 @@ void ceph_add_cap(struct inode *inode,
	}

	if (flags & CEPH_CAP_FLAG_AUTH) {
		if (ci->i_auth_cap == NULL ||
		if (!ci->i_auth_cap ||
		    ceph_seq_cmp(ci->i_auth_cap->mseq, mseq) < 0) {
			ci->i_auth_cap = cap;
			cap->mds_wanted = wanted;
@@ -728,7 +729,7 @@ static void __touch_cap(struct ceph_cap *cap)
	struct ceph_mds_session *s = cap->session;

	spin_lock(&s->s_cap_lock);
	if (s->s_cap_iterator == NULL) {
	if (!s->s_cap_iterator) {
		dout("__touch_cap %p cap %p mds%d\n", &cap->ci->vfs_inode, cap,
		     s->s_mds);
		list_move_tail(&cap->session_caps, &s->s_caps);
@@ -1248,7 +1249,10 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap,
	arg.mode = inode->i_mode;

	arg.inline_data = ci->i_inline_version != CEPH_INLINE_NONE;
	arg.flags = 0;
	if (list_empty(&ci->i_cap_snaps))
		arg.flags = CEPH_CLIENT_CAPS_NO_CAPSNAP;
	else
		arg.flags = CEPH_CLIENT_CAPS_PENDING_CAPSNAP;
	if (sync)
		arg.flags |= CEPH_CLIENT_CAPS_SYNC;

@@ -1454,13 +1458,19 @@ void ceph_flush_snaps(struct ceph_inode_info *ci,
		goto retry;
	}

	// make sure flushsnap messages are sent in proper order.
	if (ci->i_ceph_flags & CEPH_I_KICK_FLUSH) {
		__kick_flushing_caps(mdsc, session, ci, 0);
		ci->i_ceph_flags &= ~CEPH_I_KICK_FLUSH;
	}

	__ceph_flush_snaps(ci, session);
out:
	spin_unlock(&ci->i_ceph_lock);

	if (psession) {
		*psession = session;
	} else {
	} else if (session) {
		mutex_unlock(&session->s_mutex);
		ceph_put_mds_session(session);
	}
@@ -1901,11 +1911,7 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags,
		    (ci->i_ceph_flags &
		     (CEPH_I_KICK_FLUSH | CEPH_I_FLUSH_SNAPS))) {
			if (ci->i_ceph_flags & CEPH_I_KICK_FLUSH) {
				spin_lock(&mdsc->cap_dirty_lock);
				oldest_flush_tid = __get_oldest_flush_tid(mdsc);
				spin_unlock(&mdsc->cap_dirty_lock);
				__kick_flushing_caps(mdsc, session, ci,
						     oldest_flush_tid);
				__kick_flushing_caps(mdsc, session, ci, 0);
				ci->i_ceph_flags &= ~CEPH_I_KICK_FLUSH;
			}
			if (ci->i_ceph_flags & CEPH_I_FLUSH_SNAPS)
@@ -2110,7 +2116,7 @@ int ceph_fsync(struct file *file, loff_t start, loff_t end, int datasync)

	dout("fsync %p%s\n", inode, datasync ? " datasync" : "");

	ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
	ret = file_write_and_wait_range(file, start, end);
	if (ret < 0)
		goto out;

@@ -3422,7 +3428,7 @@ static void handle_cap_export(struct inode *inode, struct ceph_mds_caps *ex,
	tcap = __get_cap_for_mds(ci, target);
	if (tcap) {
		/* already have caps from the target */
		if (tcap->cap_id != t_cap_id ||
		if (tcap->cap_id == t_cap_id &&
		    ceph_seq_cmp(tcap->seq, t_seq) < 0) {
			dout(" updating import cap %p mds%d\n", tcap, target);
			tcap->cap_id = t_cap_id;
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ static int mdsmap_show(struct seq_file *s, void *p)
	struct ceph_fs_client *fsc = s->private;
	struct ceph_mdsmap *mdsmap;

	if (fsc->mdsc == NULL || fsc->mdsc->mdsmap == NULL)
	if (!fsc->mdsc || !fsc->mdsc->mdsmap)
		return 0;
	mdsmap = fsc->mdsc->mdsmap;
	seq_printf(s, "epoch %d\n", mdsmap->m_epoch);
Loading