From 1fc6ce04190570eac3bccce49941385acc907515 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 5 Oct 2023 12:01:42 +0300 Subject: [PATCH] storage: Robustify thin pool resizing Skip the check whether the resize has failed because of a wrong passphrase; this will never be the case for logical volumes without a block device. Also, disable the "Grow" button when there is not enough space, just like for regular logical volumes. --- pkg/storaged/crypto-keyslots.jsx | 2 +- pkg/storaged/lvol-tabs.jsx | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pkg/storaged/crypto-keyslots.jsx b/pkg/storaged/crypto-keyslots.jsx index 358ea47f6c8..f33d3fc1c26 100644 --- a/pkg/storaged/crypto-keyslots.jsx +++ b/pkg/storaged/crypto-keyslots.jsx @@ -228,7 +228,7 @@ export function get_existing_passphrase(block, just_type) { export function request_passphrase_on_error_handler(dlg, vals, recovered_passphrase, block) { return function (error) { - if (vals.passphrase === undefined) { + if (vals.passphrase === undefined && block) { return (passphrase_test(block, recovered_passphrase) .then(good => { if (!good) diff --git a/pkg/storaged/lvol-tabs.jsx b/pkg/storaged/lvol-tabs.jsx index 719e6c45b67..0ffa303dc04 100644 --- a/pkg/storaged/lvol-tabs.jsx +++ b/pkg/storaged/lvol-tabs.jsx @@ -134,6 +134,9 @@ function perc(ratio) { export class PoolVolTab extends React.Component { render() { const self = this; + const client = self.props.client; + const lvol = self.props.lvol; + const vgroup = client.vgroups[lvol.VolumeGroup]; function rename() { lvol_rename(self.props.lvol); @@ -143,6 +146,17 @@ export class PoolVolTab extends React.Component { grow_dialog(self.props.client, self.props.lvol, { }); } + let grow_excuse = null; + if (vgroup.FreeSize == 0) { + grow_excuse = ( +
+ {_("Not enough space to grow.")} +
+ {_("Free up space in this group: Shrink or delete other logical volumes or add another physical volume.")} +
+ ); + } + return ( @@ -160,7 +174,7 @@ export class PoolVolTab extends React.Component { {utils.fmt_size(this.props.lvol.Size)} - {_("Grow")} + {_("Grow")}