Skip to contentSkip to conversation

ceph: reinitialize mds feature bit even when session in open

PATCH In review Venky Shankar 2 participants 2 messages Nov 6, 2023 Ceph client

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: reinitialize mds feature bit even when session in open

Following along the same lines as per the user-space fix. Right now this isn't really an issue with the ceph kernel driver because of the feature bit laginess, however, that can change over time (when the new snaprealm info type is ported to the kernel driver) and depending on the MDS version that's being upgraded can cause message decoding issues - so, fix that early on.

URL: Fixes: http://tracker.ceph.com/issues/63188

---
 fs/ceph/mds_client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/mds_client.c +1 -1
index a7bffb030036..e1136009b44a 100644
@@ -4189,12 +4189,12 @@ static void handle_session(struct ceph_mds_session *session,
 			pr_info_client(cl, "mds%d reconnect success\n",
 				       session->s_mds);
 
+		session->s_features = features;
 		if (session->s_state == CEPH_MDS_SESSION_OPEN) {
 			pr_notice_client(cl, "mds%d is already opened\n",
 					 session->s_mds);
 		} else {
 			session->s_state = CEPH_MDS_SESSION_OPEN;
-			session->s_features = features;
 			renewed_caps(mdsc, session, 0);
 			if (test_bit(CEPHFS_FEATURE_METRIC_COLLECT,
 				     &session->s_features))
Signature · 1 line
2.39.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 21 lines · Venky Shankar

Following along the same lines as per the user-space fix. Right now this isn't really an issue with the ceph kernel driver because of the feature bit laginess, however, that can change over time (when the new snaprealm info type is ported to the kernel driver) and depending on the MDS version that's being upgraded can cause message decoding issues - so, fix that early on.

URL: Fixes: http://tracker.ceph.com/issues/63188

---
  fs/ceph/mds_client.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/mds_client.c +0 -0
index a7bffb030036..e1136009b44a 100644
@@ -4189,12 +4189,12 @@ static void handle_session(struct ceph_mds_session *session,
  			pr_info_client(cl, "mds%d reconnect success\n",
  				       session->s_mds);
 

fs/ceph/mds_client.c static void handle_session(struct ceph_mds_session *session, · line 4200

Quoted 10 lines
fs/ceph/mds_client.c +1 -1
+		session->s_features = features;
  		if (session->s_state == CEPH_MDS_SESSION_OPEN) {
  			pr_notice_client(cl, "mds%d is already opened\n",
  					 session->s_mds);
  		} else {
  			session->s_state = CEPH_MDS_SESSION_OPEN;
-			session->s_features = features;
  			renewed_caps(mdsc, session, 0);
  			if (test_bit(CEPHFS_FEATURE_METRIC_COLLECT,
  				     &session->s_features))

LGTM.