kernel_optimize_test/net/ceph
Ilya Dryomov 28e1581c3b libceph: clear con->out_msg on Policy::stateful_server faults
con->out_msg must be cleared on Policy::stateful_server
(!CEPH_MSG_CONNECT_LOSSY) faults.  Not doing so botches the
reconnection attempt, because after writing the banner the
messenger moves on to writing the data section of that message
(either from where it got interrupted by the connection reset or
from the beginning) instead of writing struct ceph_msg_connect.
This results in a bizarre error message because the server
sends CEPH_MSGR_TAG_BADPROTOVER but we think we wrote struct
ceph_msg_connect:

  libceph: mds0 (1)172.21.15.45:6828 socket error on write
  ceph: mds0 reconnect start
  libceph: mds0 (1)172.21.15.45:6829 socket closed (con state OPEN)
  libceph: mds0 (1)172.21.15.45:6829 protocol version mismatch, my 32 != server's 32
  libceph: mds0 (1)172.21.15.45:6829 protocol version mismatch

AFAICT this bug goes back to the dawn of the kernel client.
The reason it survived for so long is that only MDS sessions
are stateful and only two MDS messages have a data section:
CEPH_MSG_CLIENT_RECONNECT (always, but reconnecting is rare)
and CEPH_MSG_CLIENT_REQUEST (only when xattrs are involved).
The connection has to get reset precisely when such message
is being sent -- in this case it was the former.

Cc: stable@vger.kernel.org
Link: https://tracker.ceph.com/issues/47723
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
2020-10-12 15:29:27 +02:00
..
crush treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
armor.c
auth_none.c
auth_none.h
auth_x_protocol.h
auth_x.c
auth_x.h
auth.c
buffer.c
ceph_common.c libceph: move away from global osd_req_flags 2020-06-16 16:01:53 +02:00
ceph_hash.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
ceph_strings.c
cls_lock_client.c
crypto.c
crypto.h
debugfs.c libceph: dump class and method names on method calls 2020-08-03 11:03:01 +02:00
decode.c
Kconfig libceph: replace HTTP links with HTTPS ones 2020-08-03 11:05:26 +02:00
Makefile
messenger.c libceph: clear con->out_msg on Policy::stateful_server faults 2020-10-12 15:29:27 +02:00
mon_client.c libceph: switch to the new "osd blocklist add" command 2020-10-12 15:29:26 +02:00
msgpool.c
osd_client.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
osdmap.c libceph: multiple workspaces for CRUSH computations 2020-10-12 15:29:26 +02:00
pagelist.c
pagevec.c
snapshot.c
string_table.c
striper.c