From: Sage Weil <sage@newdream.net>
Date: Thu, 13 May 2010 16:06:02 +0000 (-0700)
Subject: ceph: cope with out of order (unsafe after safe) mds reply
X-Git-Tag: firefly_0821_release~9833^2~1630^2~19
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=85792d0dd6e7a7a18fba55c97e49871211b28fe0;p=firefly-linux-kernel-4.4.55.git

ceph: cope with out of order (unsafe after safe) mds reply

Signed-off-by: Sage Weil <sage@newdream.net>
---

diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 114bada97c16..40dd437a26a9 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -1871,6 +1871,12 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)
 		mutex_unlock(&mdsc->mutex);
 		goto out;
 	}
+	if (req->r_got_safe && !head->safe) {
+		pr_warning("got unsafe after safe on %llu from mds%d\n",
+			   tid, mds);
+		mutex_unlock(&mdsc->mutex);
+		goto out;
+	}
 
 	result = le32_to_cpu(head->result);