Home Home > GIT Browse > SLE12-SP5-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Henriques <lhenriques@suse.com>2019-08-27 11:14:09 +0100
committerLuis Henriques <lhenriques@suse.com>2019-09-05 10:07:45 +0100
commit4a91d87bb8d6e3f0d2985cde64578f3aa1459e15 (patch)
treea90b72ab235791038f11e832430faa479a40df32
parentbd00ea53c7b6d2c034548c29ac0a27610b6e46fd (diff)
ceph: don't blindly unregister session that is in opening state
(bsc#1148133).
-rw-r--r--patches.suse/ceph-don-t-blindly-unregister-session-that-is-in-opening-state.patch96
-rw-r--r--series.conf1
2 files changed, 97 insertions, 0 deletions
diff --git a/patches.suse/ceph-don-t-blindly-unregister-session-that-is-in-opening-state.patch b/patches.suse/ceph-don-t-blindly-unregister-session-that-is-in-opening-state.patch
new file mode 100644
index 0000000000..baab50a096
--- /dev/null
+++ b/patches.suse/ceph-don-t-blindly-unregister-session-that-is-in-opening-state.patch
@@ -0,0 +1,96 @@
+From: "Yan, Zheng" <zyan@redhat.com>
+Date: Mon, 10 Jun 2019 15:45:09 +0800
+Subject: ceph: don't blindly unregister session that is in opening state
+Git-commit: 6f0f597b5debc7c2356fa6a17e2f179066e340d0
+Patch-mainline: v5.3-rc1
+References: bsc#1148133
+
+handle_cap_export() may add placeholder caps to session that is in
+opening state. These caps' session pointer become wild after session get
+unregistered.
+
+The fix is not to unregister session in opening state during mds failovers,
+just let client to reconnect later when mds is recovered.
+
+Link: https://tracker.ceph.com/issues/40190
+Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
+Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
+Acked-by: Luis Henriques <lhenriques@suse.com>
+---
+ fs/ceph/mds_client.c | 59 +++++++++++++++++++++++-----------------------------
+ 1 file changed, 26 insertions(+), 33 deletions(-)
+
+diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
+index 709ac3bde86e..fcea46a54622 100644
+--- a/fs/ceph/mds_client.c
++++ b/fs/ceph/mds_client.c
+@@ -3737,42 +3737,35 @@ static void check_new_map(struct ceph_mds_client *mdsc,
+ ceph_mdsmap_is_laggy(newmap, i) ? " (laggy)" : "",
+ ceph_session_state_name(s->s_state));
+
+- if (i >= newmap->m_num_mds ||
+- memcmp(ceph_mdsmap_get_addr(oldmap, i),
+- ceph_mdsmap_get_addr(newmap, i),
+- sizeof(struct ceph_entity_addr))) {
+- if (s->s_state == CEPH_MDS_SESSION_OPENING) {
+- /* the session never opened, just close it
+- * out now */
+- get_session(s);
+- __unregister_session(mdsc, s);
+- __wake_requests(mdsc, &s->s_waiting);
+- ceph_put_mds_session(s);
+- } else if (i >= newmap->m_num_mds) {
+- /* force close session for stopped mds */
+- get_session(s);
+- __unregister_session(mdsc, s);
+- __wake_requests(mdsc, &s->s_waiting);
+- kick_requests(mdsc, i);
+- mutex_unlock(&mdsc->mutex);
++ if (i >= newmap->m_num_mds) {
++ /* force close session for stopped mds */
++ get_session(s);
++ __unregister_session(mdsc, s);
++ __wake_requests(mdsc, &s->s_waiting);
++ mutex_unlock(&mdsc->mutex);
+
+- mutex_lock(&s->s_mutex);
+- cleanup_session_requests(mdsc, s);
+- remove_session_caps(s);
+- mutex_unlock(&s->s_mutex);
++ mutex_lock(&s->s_mutex);
++ cleanup_session_requests(mdsc, s);
++ remove_session_caps(s);
++ mutex_unlock(&s->s_mutex);
+
+- ceph_put_mds_session(s);
++ ceph_put_mds_session(s);
+
+- mutex_lock(&mdsc->mutex);
+- } else {
+- /* just close it */
+- mutex_unlock(&mdsc->mutex);
+- mutex_lock(&s->s_mutex);
+- mutex_lock(&mdsc->mutex);
+- ceph_con_close(&s->s_con);
+- mutex_unlock(&s->s_mutex);
+- s->s_state = CEPH_MDS_SESSION_RESTARTING;
+- }
++ mutex_lock(&mdsc->mutex);
++ kick_requests(mdsc, i);
++ continue;
++ }
++
++ if (memcmp(ceph_mdsmap_get_addr(oldmap, i),
++ ceph_mdsmap_get_addr(newmap, i),
++ sizeof(struct ceph_entity_addr))) {
++ /* just close it */
++ mutex_unlock(&mdsc->mutex);
++ mutex_lock(&s->s_mutex);
++ mutex_lock(&mdsc->mutex);
++ ceph_con_close(&s->s_con);
++ mutex_unlock(&s->s_mutex);
++ s->s_state = CEPH_MDS_SESSION_RESTARTING;
+ } else if (oldstate == newstate) {
+ continue; /* nothing new with this mds */
+ }
+
diff --git a/series.conf b/series.conf
index bc7fb2911b..3eca9b01e8 100644
--- a/series.conf
+++ b/series.conf
@@ -23913,6 +23913,7 @@
patches.suse/ceph-clean-up-ceph-dir-pin-vxattr-name-sizeof.patch
patches.suse/ceph-fix-ceph-dir-rctime-vxattr-value.patch
patches.suse/ceph-fix-improper-use-of-smp_mb__before_atomic.patch
+ patches.suse/ceph-don-t-blindly-unregister-session-that-is-in-opening-state.patch
patches.suse/cifs-Use-kmemdup-in-SMB2_ioctl_init-.patch
patches.suse/fs-cifs-Drop-unlikely-before-IS_ERR-_OR_NULL-.patch
patches.suse/SMB3-Add-SMB3-1-1-GCM-to-negotiated-crypto-algorigthms.patch