1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

vgchange: acquire an exclusive VG lock for refresh

Concurrent vgchange --refresh commands can lead to hung
tasks in dm code.

Signed-off-by: wangzhiqiang <wangzhiqiang95@huawei.com>
This commit is contained in:
wangzhiqiang 2023-08-30 15:47:42 -05:00 committed by David Teigland
parent 092f58a762
commit 65d23a1d75

View File

@ -1008,7 +1008,8 @@ int vgchange(struct cmd_context *cmd, int argc, char **argv)
if (update)
flags |= READ_FOR_UPDATE;
else if (arg_is_set(cmd, activate_ARG))
else if (arg_is_set(cmd, activate_ARG) ||
arg_is_set(cmd, refresh_ARG))
flags |= READ_FOR_ACTIVATE;
if (!(handle = init_processing_handle(cmd, NULL))) {