diff options
author | Alex Elder <elder@inktank.com> | 2013-02-15 12:42:30 -0500 |
---|---|---|
committer | Alex Elder <elder@inktank.com> | 2013-02-18 13:20:22 -0500 |
commit | 4c46459cae3b945e6e167f3f3a12b68f55cc5937 (patch) | |
tree | c94c7736f781c7807915fbe9d50d4277ed239c4b /net/ceph/osd_client.c | |
parent | 2979ddb11befcd757a6ab5a04fad9e264560385b (diff) |
libceph: report defined but unsupported osd ops
If osd_req_encode_op() is given any opcode it doesn't recognize
it reports an error.
This patch fleshes out that routine to distinguish between
well-defined but unsupported values and values that are simply
bogus.
This and the next commit are related to:
http://tracker.ceph.com/issues/4126
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'net/ceph/osd_client.c')
-rw-r--r-- | net/ceph/osd_client.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index ad6b8b35f5ca..ac7bcbf19574 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -281,6 +281,60 @@ static void osd_req_encode_op(struct ceph_osd_request *req, | |||
281 | pr_err("unrecognized osd opcode %d\n", dst->op); | 281 | pr_err("unrecognized osd opcode %d\n", dst->op); |
282 | WARN_ON(1); | 282 | WARN_ON(1); |
283 | break; | 283 | break; |
284 | case CEPH_OSD_OP_STAT: | ||
285 | case CEPH_OSD_OP_MAPEXT: | ||
286 | case CEPH_OSD_OP_MASKTRUNC: | ||
287 | case CEPH_OSD_OP_SPARSE_READ: | ||
288 | case CEPH_OSD_OP_ASSERT_VER: | ||
289 | case CEPH_OSD_OP_WRITEFULL: | ||
290 | case CEPH_OSD_OP_TRUNCATE: | ||
291 | case CEPH_OSD_OP_ZERO: | ||
292 | case CEPH_OSD_OP_DELETE: | ||
293 | case CEPH_OSD_OP_APPEND: | ||
294 | case CEPH_OSD_OP_SETTRUNC: | ||
295 | case CEPH_OSD_OP_TRIMTRUNC: | ||
296 | case CEPH_OSD_OP_TMAPUP: | ||
297 | case CEPH_OSD_OP_TMAPPUT: | ||
298 | case CEPH_OSD_OP_TMAPGET: | ||
299 | case CEPH_OSD_OP_CREATE: | ||
300 | case CEPH_OSD_OP_OMAPGETKEYS: | ||
301 | case CEPH_OSD_OP_OMAPGETVALS: | ||
302 | case CEPH_OSD_OP_OMAPGETHEADER: | ||
303 | case CEPH_OSD_OP_OMAPGETVALSBYKEYS: | ||
304 | case CEPH_OSD_OP_MODE_RD: | ||
305 | case CEPH_OSD_OP_OMAPSETVALS: | ||
306 | case CEPH_OSD_OP_OMAPSETHEADER: | ||
307 | case CEPH_OSD_OP_OMAPCLEAR: | ||
308 | case CEPH_OSD_OP_OMAPRMKEYS: | ||
309 | case CEPH_OSD_OP_OMAP_CMP: | ||
310 | case CEPH_OSD_OP_CLONERANGE: | ||
311 | case CEPH_OSD_OP_ASSERT_SRC_VERSION: | ||
312 | case CEPH_OSD_OP_SRC_CMPXATTR: | ||
313 | case CEPH_OSD_OP_GETXATTRS: | ||
314 | case CEPH_OSD_OP_SETXATTRS: | ||
315 | case CEPH_OSD_OP_RESETXATTRS: | ||
316 | case CEPH_OSD_OP_RMXATTR: | ||
317 | case CEPH_OSD_OP_PULL: | ||
318 | case CEPH_OSD_OP_PUSH: | ||
319 | case CEPH_OSD_OP_BALANCEREADS: | ||
320 | case CEPH_OSD_OP_UNBALANCEREADS: | ||
321 | case CEPH_OSD_OP_SCRUB: | ||
322 | case CEPH_OSD_OP_SCRUB_RESERVE: | ||
323 | case CEPH_OSD_OP_SCRUB_UNRESERVE: | ||
324 | case CEPH_OSD_OP_SCRUB_STOP: | ||
325 | case CEPH_OSD_OP_SCRUB_MAP: | ||
326 | case CEPH_OSD_OP_WRLOCK: | ||
327 | case CEPH_OSD_OP_WRUNLOCK: | ||
328 | case CEPH_OSD_OP_RDLOCK: | ||
329 | case CEPH_OSD_OP_RDUNLOCK: | ||
330 | case CEPH_OSD_OP_UPLOCK: | ||
331 | case CEPH_OSD_OP_DNLOCK: | ||
332 | case CEPH_OSD_OP_PGLS: | ||
333 | case CEPH_OSD_OP_PGLS_FILTER: | ||
334 | pr_err("unsupported osd opcode %s\n", | ||
335 | ceph_osd_op_name(dst->op)); | ||
336 | WARN_ON(1); | ||
337 | break; | ||
284 | } | 338 | } |
285 | dst->payload_len = cpu_to_le32(src->payload_len); | 339 | dst->payload_len = cpu_to_le32(src->payload_len); |
286 | } | 340 | } |