提交 8f63ca2d 编写于 作者: A Alex Elder 提交者: Sage Weil

libceph: fix wrong opcode use in osd_req_encode_op()

The new cases added to osd_req_encode_op() caused a new sparse
error, which highlighted an existing problem that had been
overlooked since it was originally checked in.  When an unsupported
opcode is found the destination rather than the source opcode was
being used in the error message.  The two differ in their byte
order, and we want to be using the one in the source.

Fix the problem in both spots.
Reported-by: NFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: NAlex Elder <elder@inktank.com>
Reviewed-by: NJosh Durgin <josh.durgin@inktank.com>
上级 0d5af164
...@@ -249,7 +249,7 @@ static void osd_req_encode_op(struct ceph_osd_request *req, ...@@ -249,7 +249,7 @@ static void osd_req_encode_op(struct ceph_osd_request *req,
dst->watch.flag = src->watch.flag; dst->watch.flag = src->watch.flag;
break; break;
default: default:
pr_err("unrecognized osd opcode %d\n", dst->op); pr_err("unrecognized osd opcode %d\n", src->op);
WARN_ON(1); WARN_ON(1);
break; break;
case CEPH_OSD_OP_MAPEXT: case CEPH_OSD_OP_MAPEXT:
...@@ -307,7 +307,7 @@ static void osd_req_encode_op(struct ceph_osd_request *req, ...@@ -307,7 +307,7 @@ static void osd_req_encode_op(struct ceph_osd_request *req,
case CEPH_OSD_OP_PGLS: case CEPH_OSD_OP_PGLS:
case CEPH_OSD_OP_PGLS_FILTER: case CEPH_OSD_OP_PGLS_FILTER:
pr_err("unsupported osd opcode %s\n", pr_err("unsupported osd opcode %s\n",
ceph_osd_op_name(dst->op)); ceph_osd_op_name(src->op));
WARN_ON(1); WARN_ON(1);
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册