提交 23d92583 编写于 作者: A Arnd Bergmann 提交者: Zheng Zengkai

drbd: fix duplicate array initializer

stable inclusion
from stable-v5.10.121
commit bea698509934fb94112ba7de7a0a68d782bba55d
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6CQ

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bea698509934fb94112ba7de7a0a68d782bba55d

--------------------------------

[ Upstream commit 33cb0917 ]

There are two initializers for P_RETRY_WRITE:

drivers/block/drbd/drbd_main.c:3676:22: warning: initialized field overwritten [-Woverride-init]

Remove the first one since it was already ignored by the compiler
and reorder the list to match the enum definition. As P_ZEROES had
no entry, add that one instead.

Fixes: 036b17ea ("drbd: Receiving part for the PROTOCOL_UPDATE packet")
Fixes: f31e583a ("drbd: introduce P_ZEROES (REQ_OP_WRITE_ZEROES on the "wire")")
Signed-off-by: NArnd Bergmann <arnd@arndb.de>
Reviewed-by: NChristoph Böhmwalder <christoph.boehmwalder@linbit.com>
Link: https://lore.kernel.org/r/20220406190715.1938174-2-christoph.boehmwalder@linbit.comSigned-off-by: NJens Axboe <axboe@kernel.dk>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 a1f7b8fd
...@@ -3631,9 +3631,8 @@ const char *cmdname(enum drbd_packet cmd) ...@@ -3631,9 +3631,8 @@ const char *cmdname(enum drbd_packet cmd)
* when we want to support more than * when we want to support more than
* one PRO_VERSION */ * one PRO_VERSION */
static const char *cmdnames[] = { static const char *cmdnames[] = {
[P_DATA] = "Data", [P_DATA] = "Data",
[P_WSAME] = "WriteSame",
[P_TRIM] = "Trim",
[P_DATA_REPLY] = "DataReply", [P_DATA_REPLY] = "DataReply",
[P_RS_DATA_REPLY] = "RSDataReply", [P_RS_DATA_REPLY] = "RSDataReply",
[P_BARRIER] = "Barrier", [P_BARRIER] = "Barrier",
...@@ -3644,7 +3643,6 @@ const char *cmdname(enum drbd_packet cmd) ...@@ -3644,7 +3643,6 @@ const char *cmdname(enum drbd_packet cmd)
[P_DATA_REQUEST] = "DataRequest", [P_DATA_REQUEST] = "DataRequest",
[P_RS_DATA_REQUEST] = "RSDataRequest", [P_RS_DATA_REQUEST] = "RSDataRequest",
[P_SYNC_PARAM] = "SyncParam", [P_SYNC_PARAM] = "SyncParam",
[P_SYNC_PARAM89] = "SyncParam89",
[P_PROTOCOL] = "ReportProtocol", [P_PROTOCOL] = "ReportProtocol",
[P_UUIDS] = "ReportUUIDs", [P_UUIDS] = "ReportUUIDs",
[P_SIZES] = "ReportSizes", [P_SIZES] = "ReportSizes",
...@@ -3652,6 +3650,7 @@ const char *cmdname(enum drbd_packet cmd) ...@@ -3652,6 +3650,7 @@ const char *cmdname(enum drbd_packet cmd)
[P_SYNC_UUID] = "ReportSyncUUID", [P_SYNC_UUID] = "ReportSyncUUID",
[P_AUTH_CHALLENGE] = "AuthChallenge", [P_AUTH_CHALLENGE] = "AuthChallenge",
[P_AUTH_RESPONSE] = "AuthResponse", [P_AUTH_RESPONSE] = "AuthResponse",
[P_STATE_CHG_REQ] = "StateChgRequest",
[P_PING] = "Ping", [P_PING] = "Ping",
[P_PING_ACK] = "PingAck", [P_PING_ACK] = "PingAck",
[P_RECV_ACK] = "RecvAck", [P_RECV_ACK] = "RecvAck",
...@@ -3662,24 +3661,26 @@ const char *cmdname(enum drbd_packet cmd) ...@@ -3662,24 +3661,26 @@ const char *cmdname(enum drbd_packet cmd)
[P_NEG_DREPLY] = "NegDReply", [P_NEG_DREPLY] = "NegDReply",
[P_NEG_RS_DREPLY] = "NegRSDReply", [P_NEG_RS_DREPLY] = "NegRSDReply",
[P_BARRIER_ACK] = "BarrierAck", [P_BARRIER_ACK] = "BarrierAck",
[P_STATE_CHG_REQ] = "StateChgRequest",
[P_STATE_CHG_REPLY] = "StateChgReply", [P_STATE_CHG_REPLY] = "StateChgReply",
[P_OV_REQUEST] = "OVRequest", [P_OV_REQUEST] = "OVRequest",
[P_OV_REPLY] = "OVReply", [P_OV_REPLY] = "OVReply",
[P_OV_RESULT] = "OVResult", [P_OV_RESULT] = "OVResult",
[P_CSUM_RS_REQUEST] = "CsumRSRequest", [P_CSUM_RS_REQUEST] = "CsumRSRequest",
[P_RS_IS_IN_SYNC] = "CsumRSIsInSync", [P_RS_IS_IN_SYNC] = "CsumRSIsInSync",
[P_SYNC_PARAM89] = "SyncParam89",
[P_COMPRESSED_BITMAP] = "CBitmap", [P_COMPRESSED_BITMAP] = "CBitmap",
[P_DELAY_PROBE] = "DelayProbe", [P_DELAY_PROBE] = "DelayProbe",
[P_OUT_OF_SYNC] = "OutOfSync", [P_OUT_OF_SYNC] = "OutOfSync",
[P_RETRY_WRITE] = "RetryWrite",
[P_RS_CANCEL] = "RSCancel", [P_RS_CANCEL] = "RSCancel",
[P_CONN_ST_CHG_REQ] = "conn_st_chg_req", [P_CONN_ST_CHG_REQ] = "conn_st_chg_req",
[P_CONN_ST_CHG_REPLY] = "conn_st_chg_reply", [P_CONN_ST_CHG_REPLY] = "conn_st_chg_reply",
[P_RETRY_WRITE] = "retry_write", [P_RETRY_WRITE] = "retry_write",
[P_PROTOCOL_UPDATE] = "protocol_update", [P_PROTOCOL_UPDATE] = "protocol_update",
[P_TRIM] = "Trim",
[P_RS_THIN_REQ] = "rs_thin_req", [P_RS_THIN_REQ] = "rs_thin_req",
[P_RS_DEALLOCATED] = "rs_deallocated", [P_RS_DEALLOCATED] = "rs_deallocated",
[P_WSAME] = "WriteSame",
[P_ZEROES] = "Zeroes",
/* enum drbd_packet, but not commands - obsoleted flags: /* enum drbd_packet, but not commands - obsoleted flags:
* P_MAY_IGNORE * P_MAY_IGNORE
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册