1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

writecache: check if cachevol is writable

before trying to initialize it (since wipe_lv
does not return an error if it fails to write.)
This commit is contained in:
David Teigland 2020-02-11 12:59:39 -06:00
parent 892a182975
commit cba06012ac

View File

@ -5351,6 +5351,11 @@ static int _writecache_zero(struct cmd_context *cmd, struct logical_volume *lv)
};
int ret;
if (!(lv->status & LVM_WRITE)) {
log_error("Cannot initialize readonly LV %s", display_lvname(lv));
return 0;
}
if (test_mode())
return 1;