diff mbox

multipathd: add lock protection for cli_list_status

Message ID CEB9978CF3252343BE3C67AC9F0086A34295B3BB@H3CMLB14-EX.srv.huawei-3com.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show

Commit Message

Chongyun Wu Feb. 23, 2018, 9:58 a.m. UTC
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 <wu.chongyun@h3c.com>
---
  multipathd/main.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin Wilck Feb. 26, 2018, 1:52 p.m. UTC | #1
On Fri, 2018-02-23 at 09:58 +0000, Chongyun Wu wrote:
> 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 <wu.chongyun@h3c.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>

> ---
>   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);
diff mbox

Patch

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);