From patchwork Sat Feb 16 17:00:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2152171 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 1B44B3FDF1 for ; Sat, 16 Feb 2013 17:00:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753638Ab3BPRAq (ORCPT ); Sat, 16 Feb 2013 12:00:46 -0500 Received: from mail-qa0-f48.google.com ([209.85.216.48]:56584 "EHLO mail-qa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753559Ab3BPRAq (ORCPT ); Sat, 16 Feb 2013 12:00:46 -0500 Received: by mail-qa0-f48.google.com with SMTP id j8so736571qah.14 for ; Sat, 16 Feb 2013 09:00:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=q8QLNWfWH91QcTSiqxicagAGeDzOfbxfG5GtL2Q53uw=; b=Sd9IVnB4fKlSxUiMkdHegp3/LhyneHTz70EpQv7HfF5pR4tbxmQMyumxznm83GxoLg 7ctU7Nh270caI2+dQq9RtsFjvgWbQaz36lpFn/0sOodTkOIAxQrlWdovschTFModzLa+ 0fd0sJlhKP+c/FvCnLQaXbkX7mcrUuyYHqx3pENEJBI7pKICH5/dXXlhNkU2WQu/heYT WdmeWA9j3PQh+jBgzhTuVCUshEX62WfMltSPHVJGI5WLgpequIM/W9DkSqIRuRJUTLQC JO6ECQwDuV/9gh7BGpPilOujTcEli31S7hE/kC6SB3LWYKAb/qXK/eoOfHr8GJh6v58r FMmw== X-Received: by 10.224.18.205 with SMTP id x13mr3431600qaa.9.1361034045497; Sat, 16 Feb 2013 09:00:45 -0800 (PST) Received: from [172.22.22.4] (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPS id z17sm20559963qem.4.2013.02.16.09.00.43 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 16 Feb 2013 09:00:44 -0800 (PST) Message-ID: <511FBB3B.4040004@inktank.com> Date: Sat, 16 Feb 2013 11:00:43 -0600 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: ceph-devel@vger.kernel.org Subject: [PATCH 1/2] libceph: report defined but unsupported osd ops References: <511FBB12.6050207@inktank.com> In-Reply-To: <511FBB12.6050207@inktank.com> X-Gm-Message-State: ALoCoQmFqtk/b6pMXMe23+fNdoLvg8RJPBANf/CbX0XT2bDi9Y2yDazjeHOW1Y7Z5Xsj0QIjRAW9 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org 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 --- net/ceph/osd_client.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) } diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index ad6b8b3..ac7bcbf 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, pr_err("unrecognized osd opcode %d\n", dst->op); WARN_ON(1); break; + case CEPH_OSD_OP_STAT: + case CEPH_OSD_OP_MAPEXT: + case CEPH_OSD_OP_MASKTRUNC: + case CEPH_OSD_OP_SPARSE_READ: + case CEPH_OSD_OP_ASSERT_VER: + case CEPH_OSD_OP_WRITEFULL: + case CEPH_OSD_OP_TRUNCATE: + case CEPH_OSD_OP_ZERO: + case CEPH_OSD_OP_DELETE: + case CEPH_OSD_OP_APPEND: + case CEPH_OSD_OP_SETTRUNC: + case CEPH_OSD_OP_TRIMTRUNC: + case CEPH_OSD_OP_TMAPUP: + case CEPH_OSD_OP_TMAPPUT: + case CEPH_OSD_OP_TMAPGET: + case CEPH_OSD_OP_CREATE: + case CEPH_OSD_OP_OMAPGETKEYS: + case CEPH_OSD_OP_OMAPGETVALS: + case CEPH_OSD_OP_OMAPGETHEADER: + case CEPH_OSD_OP_OMAPGETVALSBYKEYS: + case CEPH_OSD_OP_MODE_RD: + case CEPH_OSD_OP_OMAPSETVALS: + case CEPH_OSD_OP_OMAPSETHEADER: + case CEPH_OSD_OP_OMAPCLEAR: + case CEPH_OSD_OP_OMAPRMKEYS: + case CEPH_OSD_OP_OMAP_CMP: + case CEPH_OSD_OP_CLONERANGE: + case CEPH_OSD_OP_ASSERT_SRC_VERSION: + case CEPH_OSD_OP_SRC_CMPXATTR: + case CEPH_OSD_OP_GETXATTRS: + case CEPH_OSD_OP_SETXATTRS: + case CEPH_OSD_OP_RESETXATTRS: + case CEPH_OSD_OP_RMXATTR: + case CEPH_OSD_OP_PULL: + case CEPH_OSD_OP_PUSH: + case CEPH_OSD_OP_BALANCEREADS: + case CEPH_OSD_OP_UNBALANCEREADS: + case CEPH_OSD_OP_SCRUB: + case CEPH_OSD_OP_SCRUB_RESERVE: + case CEPH_OSD_OP_SCRUB_UNRESERVE: + case CEPH_OSD_OP_SCRUB_STOP: + case CEPH_OSD_OP_SCRUB_MAP: + case CEPH_OSD_OP_WRLOCK: + case CEPH_OSD_OP_WRUNLOCK: + case CEPH_OSD_OP_RDLOCK: + case CEPH_OSD_OP_RDUNLOCK: + case CEPH_OSD_OP_UPLOCK: + case CEPH_OSD_OP_DNLOCK: + case CEPH_OSD_OP_PGLS: + case CEPH_OSD_OP_PGLS_FILTER: + pr_err("unsupported osd opcode %s\n", + ceph_osd_op_name(dst->op)); + WARN_ON(1); + break; } dst->payload_len = cpu_to_le32(src->payload_len);