Whamcloud - gitweb
LU-8582 target: send error reply on wrong opcode 61/47761/6
authorLi Xi <lixi@ddn.com>
Tue, 21 Jun 2022 12:06:22 +0000 (20:06 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 18 Jul 2022 05:36:06 +0000 (05:36 +0000)
commit566edb8c43e65ed4cb99614c7c753965bb201366
tree38dc794f6f8008bdc20a71e8e095e2e4f6393c5d
parent7dc6e1128a030c7e12eb23ea41935ed6fe77ce1f
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

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