diff options
author | Yi Wang <wang.yi59@zte.com.cn> | 2021-08-13 13:49:13 +0800 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2021-08-16 09:45:40 -0500 |
commit | 47bcb446b83f9aa4fca74301fda109a8bf670fbb (patch) | |
tree | 765bd884d055bbfe7a6d2e7c834c6c31ae040805 /tools/lvchange.c | |
parent | e5c0562654b8449f91c423e92e9b78d4ce986dc3 (diff) | |
download | lvm2-47bcb446b83f9aa4fca74301fda109a8bf670fbb.tar.gz |
lvchange: fix lvchange refresh failed for dm suspend or resume failed
When multiple lvchange refresh processes executed at the same time,
suspend/resume ioctl on the same dm, some of these commands will be failed
for dm aready change status, and ioctl will return EINVAL in _do_dm_ioctl function.
to avoid this problem, add READ_FOR_ACTIVATE flags in lvchange refresh process,
it will hold LCK_WRITE lock and avoid suspend/resume dm at the same time.
Signed-off-by: Long YunJian <long.yunjian@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
Diffstat (limited to 'tools/lvchange.c')
-rw-r--r-- | tools/lvchange.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lvchange.c b/tools/lvchange.c index d4c40df47..0525bc53c 100644 --- a/tools/lvchange.c +++ b/tools/lvchange.c @@ -1622,7 +1622,7 @@ int lvchange_refresh_cmd(struct cmd_context *cmd, int argc, char **argv) cmd->lockd_vg_default_sh = 1; cmd->ignore_device_name_mismatch = 1; - return process_each_lv(cmd, argc, argv, NULL, NULL, 0, + return process_each_lv(cmd, argc, argv, NULL, NULL, READ_FOR_ACTIVATE, NULL, &_lvchange_refresh_check, &_lvchange_refresh_single); } |