From patchwork Fri Feb 23 09:58:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chongyun Wu X-Patchwork-Id: 10237189 X-Patchwork-Delegate: christophe.varoqui@free.fr 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 8FCA5602DC for ; Fri, 23 Feb 2018 09:58:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CA30294D7 for ; Fri, 23 Feb 2018 09:58:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D71F294DC; Fri, 23 Feb 2018 09:58:49 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5B6D2294D7 for ; Fri, 23 Feb 2018 09:58:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9C20B4F1AC; Fri, 23 Feb 2018 09:58:46 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A6ED65D965; Fri, 23 Feb 2018 09:58:45 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3B5BC18033EB; Fri, 23 Feb 2018 09:58:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w1N9wfMP001942 for ; Fri, 23 Feb 2018 04:58:41 -0500 Received: by smtp.corp.redhat.com (Postfix) id 342A45C579; Fri, 23 Feb 2018 09:58:41 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2A52A5C1A1 for ; Fri, 23 Feb 2018 09:58:38 +0000 (UTC) Received: from h3cmg01-ex.h3c.com (smtp.h3c.com [60.191.123.56]) by mx1.redhat.com (Postfix) with ESMTP id 5009428140 for ; Fri, 23 Feb 2018 09:58:35 +0000 (UTC) Received: from BJHUB01-EX.srv.huawei-3com.com (unknown [10.63.20.169]) by h3cmg01-ex.h3c.com with smtp id 0f5a_0365_2af6d741_290d_4239_8e2c_1ab84f0e86e6; Fri, 23 Feb 2018 17:58:33 +0800 Received: from H3CMLB14-EX.srv.huawei-3com.com ([fe80::f804:6772:bd71:f07f]) by BJHUB01-EX.srv.huawei-3com.com ([::1]) with mapi id 14.03.0248.002; Fri, 23 Feb 2018 17:58:25 +0800 From: Chongyun Wu To: "dm-devel@redhat.com" Thread-Topic: [dm-devel][PATCH] multipathd: add lock protection for cli_list_status Thread-Index: AdOsTEzu8yg6zS5qQjin8otle1EgEA== Date: Fri, 23 Feb 2018 09:58:24 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.125.136.149] MIME-Version: 1.0 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 23 Feb 2018 09:58:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 23 Feb 2018 09:58:36 +0000 (UTC) for IP:'60.191.123.56' DOMAIN:'smtp.h3c.com' HELO:'h3cmg01-ex.h3c.com' FROM:'wu.chongyun@h3c.com' RCPT:'' X-RedHat-Spam-Score: 0.82 (HELO_DYNAMIC_DHCP, RCVD_IN_DNSWL_NONE, SPF_PASS, T_RP_MATCHES_RCVD) 60.191.123.56 smtp.h3c.com 60.191.123.56 smtp.h3c.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id w1N9wfMP001942 X-loop: dm-devel@redhat.com Cc: Guozhonghua , Changwei Ge , Changlimin Subject: [dm-devel] [PATCH] multipathd: add lock protection for cli_list_status X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 23 Feb 2018 09:58:47 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP cli_list_status will access vecs->pathvec which should have lock protection, otherwise might get inconsistent data or other problem. Signed-off-by: Chongyun Wu Reviewed-by: Martin Wilck --- multipathd/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multipathd/main.c b/multipathd/main.c index e74a448..b4e15eb 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -1204,7 +1204,7 @@ uxlsnrloop (void * ap) set_handler_callback(LIST+PATHS+RAW+FMT, cli_list_paths_raw); set_handler_callback(LIST+PATH, cli_list_path); set_handler_callback(LIST+MAPS, cli_list_maps); - set_unlocked_handler_callback(LIST+STATUS, cli_list_status); + set_handler_callback(LIST+STATUS, cli_list_status); set_unlocked_handler_callback(LIST+DAEMON, cli_list_daemon); set_handler_callback(LIST+MAPS+STATUS, cli_list_maps_status); set_handler_callback(LIST+MAPS+STATS, cli_list_maps_stats);