Whamcloud - gitweb
LU-8582 target: send error reply on wrong opcode
authorLi Xi <lixi@ddn.com>
Tue, 21 Jun 2022 12:06:22 +0000 (20:06 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 1 Jul 2023 10:03:08 +0000 (10:03 +0000)
commit76e7d3b5be31121a71431f63f1ddd102be2bc01f
tree22516fc4a1ad51fd4fecdd2c133523982a2088d5
parent2c5348242025558882320cc94e45deed65a849c2
LU-8582 target: send error reply on wrong opcode

Unknown opcode does not necessarily means insane client. A new client
might send RPCs with new opcodes to an old server. The client might
desperately stuck there waiting for a reply. So, send an error back
when RPC has a wrong opcode.

This patch returns the EOPNOTSUPP to client instead of block. ENOTSUPP
is not used here since strerror() does not understand ENOTSUPP.

OBD_FAIL_OST_OPCODE=0x253 is added for fault injection test of opcode.
To test whether an invalid opcode is handled properly on OST, use the
following command:

    lctl set_param fail_val=${opcode} fail_loc=0x253

Lustre-change: https://review.whamcloud.com/47761
Lustre-commit: 03c1ddf19c83891683e1726f240a2449941e8b22

Change-Id: I46ca62bc532b92368e06a4f883b102c7186c453c
Signed-off-by: Li Xi <lixi@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/51513
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/include/obd_support.h
lustre/target/tgt_handler.c
lustre/tests/sanity.sh