[SRU][MANTIC][PATCH 4/5] Revert "UBUNTU: SAUCE: ceph: dump info about cap flushes when we're waiting too long for them"

Dimitri John Ledkov dimitri.ledkov at canonical.com
Fri Oct 27 16:53:46 UTC 2023


BugLink: https://bugs.launchpad.net/bugs/2041613

This reverts commit 834ebb591fa2a739892b2d19ccaa77ca6178660f.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov at canonical.com>
---
 fs/ceph/caps.c       | 15 +--------------
 fs/ceph/inode.c      |  1 -
 fs/ceph/mds_client.c | 36 ++----------------------------------
 fs/ceph/snap.c       |  1 -
 fs/ceph/super.h      |  2 --
 5 files changed, 3 insertions(+), 52 deletions(-)

diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index b9811b5d6d..9588801bcd 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -1944,7 +1944,6 @@ static u64 __mark_caps_flushing(struct inode *inode,
 	swap(cf, ci->i_prealloc_cap_flush);
 	cf->caps = flushing;
 	cf->wake = wake;
-	cf->ci = ci;
 
 	spin_lock(&mdsc->cap_dirty_lock);
 	list_del_init(&ci->i_dirty_item);
@@ -3825,10 +3824,6 @@ static void handle_cap_flush_ack(struct inode *inode, u64 flush_tid,
 	bool wake_ci = false;
 	bool wake_mdsc = false;
 
-	/* track latest cap flush ack seen for this inode */
-	if (flush_tid > ci->i_last_cap_flush_ack)
-		ci->i_last_cap_flush_ack = flush_tid;
-
 	list_for_each_entry_safe(cf, tmp_cf, &ci->i_cap_flush_list, i_list) {
 		/* Is this the one that was flushed? */
 		if (cf->tid == flush_tid)
@@ -4460,11 +4455,7 @@ void ceph_handle_caps(struct ceph_mds_session *session,
 	      session->s_seq, (unsigned)seq);
 
 	if (!inode) {
-		if (op == CEPH_CAP_OP_FLUSH_ACK)
-			pr_info_client(cl, "can't find ino %llx:%llx for flush_ack!\n",
-				       vino.snap, vino.ino);
-		else
-			doutc(cl, " i don't have ino %llx\n", vino.ino);
+		doutc(cl, " i don't have ino %llx\n", vino.ino);
 
 		switch (op) {
 		case CEPH_CAP_OP_IMPORT:
@@ -4522,10 +4513,6 @@ void ceph_handle_caps(struct ceph_mds_session *session,
 		doutc(cl, " no cap on %p %llx.%llx from mds%d\n",
 		      inode, ceph_vinop(inode), session->s_mds);
 		spin_unlock(&ci->i_ceph_lock);
-		if (op == CEPH_CAP_OP_FLUSH_ACK)
-			pr_info_client(cl, "no cap on %p %llx.%llx from "
-				       "mds%d for flush_ack!\n",
-				       inode, ceph_vinop(inode), session->s_mds);
 		switch (op) {
 		case CEPH_CAP_OP_REVOKE:
 		case CEPH_CAP_OP_GRANT:
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index bb8f27d738..6c6b0fe1dd 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -622,7 +622,6 @@ struct inode *ceph_alloc_inode(struct super_block *sb)
 	INIT_LIST_HEAD(&ci->i_cap_snaps);
 	ci->i_head_snapc = NULL;
 	ci->i_snap_caps = 0;
-	ci->i_last_cap_flush_ack = 0;
 
 	ci->i_last_rd = ci->i_last_wr = jiffies - 3600 * HZ;
 	for (i = 0; i < CEPH_FILE_MODE_BITS; i++)
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index a6f54b7e58..289444bc3f 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -2277,28 +2277,6 @@ static int check_caps_flush(struct ceph_mds_client *mdsc,
 	return ret;
 }
 
-static void dump_cap_flushes(struct ceph_mds_client *mdsc, u64 want_tid)
-{
-	struct ceph_client *cl = mdsc->fsc->client;
-	struct ceph_cap_flush *cf;
-
-	pr_info_client(cl, "still waiting for cap flushes through %llu:\n",
-		       want_tid);
-	spin_lock(&mdsc->cap_dirty_lock);
-	list_for_each_entry(cf, &mdsc->cap_flush_list, g_list) {
-		struct inode *inode = &cf->ci->netfs.inode;
-
-		if (cf->tid > want_tid)
-			break;
-		pr_info_client(cl, "%p %llx.%llx %s %llu %llu %d%s\n",
-			       inode, ceph_vinop(inode),
-			       ceph_cap_string(cf->caps), cf->tid,
-			       cf->ci->i_last_cap_flush_ack, cf->wake,
-			       cf->is_capsnap ? " is_capsnap" : "");
-	}
-	spin_unlock(&mdsc->cap_dirty_lock);
-}
-
 /*
  * flush all dirty inode data to disk.
  *
@@ -2308,19 +2286,11 @@ static void wait_caps_flush(struct ceph_mds_client *mdsc,
 			    u64 want_flush_tid)
 {
 	struct ceph_client *cl = mdsc->fsc->client;
-	int i = 0;
-	long ret;
 
 	doutc(cl, "want %llu\n", want_flush_tid);
 
-	do {
-		ret = wait_event_timeout(mdsc->cap_flushing_wq,
-			   check_caps_flush(mdsc, want_flush_tid), 60 * HZ);
-		if (ret == 0 && ++i < 5)
-			dump_cap_flushes(mdsc, want_flush_tid);
-		else if (ret == 1)
-			pr_info_client(cl, "condition evaluated to true after timeout!\n");
-	} while (ret == 0);
+	wait_event(mdsc->cap_flushing_wq,
+		   check_caps_flush(mdsc, want_flush_tid));
 
 	doutc(cl, "ok, flushed thru %llu\n", want_flush_tid);
 }
@@ -5904,8 +5874,6 @@ static void mds_dispatch(struct ceph_connection *con, struct ceph_msg *msg)
 
 	mutex_lock(&mdsc->mutex);
 	if (__verify_registered_session(mdsc, s) < 0) {
-		pr_info_client(cl, "dropping tid %llu from unregistered session %d\n",
-			       msg->hdr.tid, s->s_mds);
 		mutex_unlock(&mdsc->mutex);
 		goto out;
 	}
diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c
index 0e6d9eed18..68964e5beb 100644
--- a/fs/ceph/snap.c
+++ b/fs/ceph/snap.c
@@ -595,7 +595,6 @@ static void ceph_queue_cap_snap(struct ceph_inode_info *ci,
 	      ceph_cap_string(dirty), capsnap->need_flush ? "" : "no_flush");
 	ihold(inode);
 
-	capsnap->cap_flush.ci = ci;
 	capsnap->follows = old_snapc->seq;
 	capsnap->issued = __ceph_caps_issued(ci, NULL);
 	capsnap->dirty = dirty;
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index 7fb990c212..a5faebed40 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -210,7 +210,6 @@ struct ceph_cap_flush {
 	bool is_capsnap; /* true means capsnap */
 	struct list_head g_list; // global
 	struct list_head i_list; // per inode
-	struct ceph_inode_info *ci;
 };
 
 /*
@@ -416,7 +415,6 @@ struct ceph_inode_info {
 	struct ceph_snap_context *i_head_snapc;  /* set if wr_buffer_head > 0 or
 						    dirty|flushing caps */
 	unsigned i_snap_caps;           /* cap bits for snapped files */
-	u64 i_last_cap_flush_ack;		/* latest cap flush_ack tid for this inode */
 
 	unsigned long i_last_rd;
 	unsigned long i_last_wr;
-- 
2.34.1




More information about the kernel-team mailing list