Re: [linux-lvm] vgchange acquire an exclusive VG lock for refresh

David Teigland <[email protected]>
Newsgroups dev.linux.lists.linux-lvm
Message-ID <[email protected]>
On Tue, Aug 29, 2023 at 02:36:53PM +0800, wangzhiqiang (Q) wrote:
> diff --git a/tools/vgchange.c b/tools/vgchange.c
> index f07b245bd..f35ff4c0e 100644
> --- a/tools/vgchange.c
> +++ b/tools/vgchange.c
> @@ -1003,7 +1003,7 @@ int vgchange(struct cmd_context *cmd, int argc, char **argv)
>                 init_external_device_info_source(DEV_EXT_NONE);
>         }
> 
> -       if (update)
> +       if (update || arg_is_set(cmd, refresh_ARG))
>                 flags |= READ_FOR_UPDATE;
>         else if (arg_is_set(cmd, activate_ARG))
>                 flags |= READ_FOR_ACTIVATE;

Shouldn't it be:

          else if (arg_is_set(cmd, activate_ARG) ||
                   arg_is_set(cmd, refresh_ARG))
                flags |= READ_FOR_ACTIVATE;

READ_FOR_ACTIVATE should translate to an ex lock like READ_FOR_UPDATE.
Note the same fix for lvchange refresh in commit 47bcb446b83f9aa4fca74301fda109a8bf670fbb

Dave
_______________________________________________
linux-lvm mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.