Re: vgchange acquire an exclusive VG lock for refresh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
linux-lvm@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/




[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux