From patchwork Wed Jun 27 13:05:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 10491583 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1BFA360230 for ; Wed, 27 Jun 2018 13:06:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A79728BF5 for ; Wed, 27 Jun 2018 13:06:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2A7E28C00; Wed, 27 Jun 2018 13:06:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E2F528BF5 for ; Wed, 27 Jun 2018 13:06:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934367AbeF0NGA (ORCPT ); Wed, 27 Jun 2018 09:06:00 -0400 Received: from mout.gmx.net ([212.227.17.21]:55047 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934313AbeF0NF7 (ORCPT ); Wed, 27 Jun 2018 09:05:59 -0400 Received: from localhost.localdomain ([122.224.77.194]) by mail.gmx.com (mrgmx102 [212.227.17.174]) with ESMTPSA (Nemesis) id 0MELdk-1fNCqN3XWC-00FPo8; Wed, 27 Jun 2018 15:05:52 +0200 From: Chengguang Xu To: ceph-devel@vger.kernel.org Cc: idryomov@gmail.com, zyan@redhat.com, Chengguang Xu Subject: [PATCH] libceph: stop parsing when detecting bad option Date: Wed, 27 Jun 2018 21:05:08 +0800 Message-Id: <20180627130508.26451-1-cgxu519@gmx.com> X-Mailer: git-send-email 2.17.1 X-Provags-ID: V03:K1:E9w9mgJNizHhbxSJpMLyygXZ2aH9oB0ftYw2BG9KhzitdeJNdXy V6qlLl1kSmHWu7gtnMS++K+bUpWyyKaFzRsjx54d+ZErYBw22rKlYNRoLzosscJLY50kXUp 61aqfmJhVvCNcCo8yQRZmXLjYG18hsH97b9gie5GnoN4pjXJmB0VKCboEoriH6QWCnUJ6nU 9v10dcGJmeZO6WQwGRYWw== X-UI-Out-Filterresults: notjunk:1; V01:K0:B6On8nii81s=:n/oJbT5dttNUJbROwOk4Ap VeQ2/NjEF+9JbZQxS33KeJXGt2NVBi73G8HYsXsb0sLT4Sf7/bUb0AzwcNqchso070qYz7Qt6 QbE7aDQkqFnlLn/o4Wv46y3XchR6IaOwbPqm5GIzzlVu7FNwfCCTTGPoC0QpCsxaYujztkaEB sSWMgu8MoI9lPn9mhXLP22BRV7OVH5RckpxtiCUVfyQGvkGcAQa+aBA1bVeBURmxR/ndvYS2f S8ieau1wgiLMnEt5lbnniEbn/UFKfJUJj4aA3zavpv8NBXY6rplA0W/UgDFB6bLqaSnlsTt5g 82ErnLhH9ufx9AEbst0M/m4xNua7J/huOtfYqNl92QbJCZFfS2lny9Is3A2+VF7QLM0b6wDez 7wfeZtKOP6KGPew6TS1EXu7mpwPdluNDlqxHM9XMQs3Rg7FcGL1QtptVYRD/1jY75xivgrNIU VUXLkM9QUm6z+g9nlWcfLW8QHPpjTqIMAJ4l15wvMkXkzRv0nFq7KzhcYHVRL1rkj4+c/YS/S z0f11Flke0dhNQt+bGVdSRtRS8d1N4EP58FrLJ50yDPrRf3zvUgfosoH/2YWdsO2sn9WwBoWO kzckQ/SMAYd6GuFX9mSrnzqBQtkbUiycf33wKqXWAvc6miObaIBcK4yO6Pi3I6bJaLMUGnSuv rGqdeFI8RahM/V0JDDEuT99jiGjGxAQ2kYIdpRNxyp34k08tXanEIVzH1h2QcH8gzNYKrmcQ3 tetpPA4PlDJqfaJQFZPqgml6ThRb3+Oo5ai2dVL9+NnUSH3WRnjKb0tTOKg= Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is no reason to continue option parsing after detecting bad option. Signed-off-by: Chengguang Xu --- net/ceph/ceph_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c index 584fdbef2088..a75f1640f50a 100644 --- a/net/ceph/ceph_common.c +++ b/net/ceph/ceph_common.c @@ -398,7 +398,7 @@ ceph_parse_options(char *options, const char *dev_name, if (ret < 0) { pr_err("bad mount option arg (not int) " "at '%s'\n", c); - continue; + goto out; } dout("got int token %d val %d\n", token, intval); } else if (token > Opt_last_int && token < Opt_last_string) {