diff options
author | David Teigland <teigland@redhat.com> | 2021-07-21 13:16:21 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2021-07-21 13:16:21 -0500 |
commit | d91c018732c07c5d8c6bfc05570dbc82644a957c (patch) | |
tree | 20f0631dad131511bdbd618d04ec6c562b44179d | |
parent | 640fe5cf42fd136e60778513c5fc28499e78f9c2 (diff) | |
download | lvm2-d91c018732c07c5d8c6bfc05570dbc82644a957c.tar.gz |
writecache: fix missing sync_dev_names when attaching cache
When activating an LV to check the fs block size, wait for
the LV dev to be accessible before running blkid on it.
-rw-r--r-- | tools/lvconvert.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 7fbe84952..f699443fd 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -6124,6 +6124,12 @@ int lvconvert_writecache_attach_single(struct cmd_context *cmd, log_error("Failed to activate LV to check block size %s", display_lvname(lv)); goto bad; } + if (!sync_local_dev_names(cmd)) { + log_error("Failed to sync local dev names."); + if (!deactivate_lv(cmd, lv)) + stack; + goto bad; + } } if (!_set_writecache_block_size(cmd, lv, &block_size_sectors)) { |